PK
ZMLJsk NoticeItem.xaml
PK
ZMLq?} NoticeItem.xaml.csusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BANAPRESSO_KIOSK.UserControls
{
///
/// NoticeItem.xaml에 대한 상호 작용 논리
///
public partial class NoticeItem : UserControl
{
public NoticeItem()
{
InitializeComponent();
}
}
}PK
FTLel NoticeControl.xaml.csusing BANAPRESSO_KIOSK.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace BANAPRESSO_KIOSK.UserControls
{
///
/// NoticeControl.xaml에 대한 상호 작용 논리
///
public partial class NoticeControl : UserControl
{
private DispatcherTimer _dt;
private DispatcherTimer _dt2;
private List _noticeLists;
private int _index = 0;
public NoticeControl()
{
InitializeComponent();
_dt = new DispatcherTimer()
{
Interval = new TimeSpan(0, 0, 5)
};
_dt.Tick += Dt_Tick;
_noticeLists = new List();
_dt2 = new DispatcherTimer()
{
Interval = new TimeSpan(0, 0, 1)
};
_dt2.Tick += _dt2_Tick;
this.Loaded += NoticeControl_Loaded;
this.DataContextChanged += NoticeControl_DataContextChanged;
}
public void StopTimer()
{
_dt.Stop();
_dt2.Stop();
_dt.Tick -= Dt_Tick;
_dt2.Tick -= _dt2_Tick;
_dt = null;
_dt2 = null;
}
private void NoticeControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if ((DataContext is List) == false)
return;
_noticeLists = (DataContext as List);
}
private void NoticeControl_Loaded(object sender, RoutedEventArgs e)
{
_dt.Start();
}
private void Dt_Tick(object sender, EventArgs e)
{
if (_noticeLists.Count <= 0)
return;
xNi1.Visibility = Visibility.Visible;
xNi1Hidden.Visibility = Visibility.Collapsed;
_dt.Stop();
xNi1.xNotiText.DataContext = _noticeLists[_index];
_index++;
if (_index >= _noticeLists.Count)
_index = 0;
xNi2.xNotiText.DataContext = _noticeLists[_index];
if (_noticeLists[_index].sType == "이벤트")
{
xNi2.xNotiImg.Source = new BitmapImage(new Uri("/BANAPRESSO_KIOSK;component/Images/notice_ico_event.png", UriKind.RelativeOrAbsolute));
}
else
{
xNi2.xNotiImg.Source = new BitmapImage(new Uri("/BANAPRESSO_KIOSK;component/Images/notice_ico_noti.png", UriKind.RelativeOrAbsolute));
}
_dt.Start();
_dt2.Start();
}
private void _dt2_Tick(object sender, EventArgs e)
{
_dt2.Stop();
xNi1Hidden.DataContext = _noticeLists[_index];
if (_noticeLists[_index].sType == "이벤트")
{
xNi1.xNotiImg.Source = new BitmapImage(new Uri("/BANAPRESSO_KIOSK;component/Images/notice_ico_event.png", UriKind.RelativeOrAbsolute));
}
else
{
xNi1.xNotiImg.Source = new BitmapImage(new Uri("/BANAPRESSO_KIOSK;component/Images/notice_ico_noti.png", UriKind.RelativeOrAbsolute));
}
xNi1.Visibility = Visibility.Collapsed;
xNi1Hidden.Visibility = Visibility.Visible;
}
}
}PK
hSLKm NoticeControl.xaml
PK
ZMLJsk $ ! NoticeItem.xaml
e_pe_pe_pPK
ZMLq?} $ ! ( NoticeItem.xaml.cs
e_p]p]pPK
FTLel $
NoticeControl.xaml.cs
*&*&e_pPK
hSLKm $ R NoticeControl.xaml
# y`*ǧy`e_pPK !