Exemplo n.º 1
0
        protected override void OnLoaded()
        {
            base.OnLoaded();
            BtnCommand             = new RelayCommand <string>(OnCommand);
            MouseDubleClickCommand = new RelayCommand <UrlInfo>(OnMouseDubleClick);
            RegeistMessenger <UrlInfo>(OnRequestCreateUrl);

            ReceiveAddressBookMonitor.Default.MonitorCallBack += accounts =>
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    var selectedItem = this.SelectedItem;
                    UrlInfos.Clear();
                    accounts.ForEach(x => UrlInfos.Add(new UrlInfo()
                    {
                        Address = x.Address, Tag = x.Tag
                    }));
                    if (selectedItem != null)
                    {
                        this.SelectedItem = UrlInfos.FirstOrDefault(x => x.Address == selectedItem.Address);
                    }
                });
                ReceiveAddressBookMonitor.Default.Start(6000);
            };

            LoadUrls();
            UrlInfos.CollectionChanged += (s, e) => { RaisePropertyChanged("UrlInfos"); };
        }
Exemplo n.º 2
0
        protected override void OnLoaded()
        {
            base.OnLoaded();

            BtnCommand             = new RelayCommand <string>(OnCommand);
            MouseDubleClickCommand = new RelayCommand <UrlInfo>(OnMouseDubleClick);
            RegeistMessenger <UrlInfo>(OnRequestCreateUrl);
            RegeistMessenger <PayUrlPageType>(OnGetRequest);
            PayAddressBookMonitor.Default.MonitorCallBack += books =>
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    string account = null;
                    if (SelectedItem != null)
                    {
                        account = SelectedItem.Address;
                    }
                    UrlInfos.Clear();
                    books.ForEach(x =>
                    {
                        UrlInfos.Add(new UrlInfo(x));
                    });
                    if (account != null)
                    {
                        SelectedItem = UrlInfos.FirstOrDefault(x => x.Address == account);
                    }
                    StaticViewModel.GlobalViewModel.IsLoading = false;
                });
            };
            LoadUrls();
            UrlInfos.CollectionChanged += (s, e) => { RaisePropertyChanged("UrlInfos"); };
        }
Exemplo n.º 3
0
 void LoadUrls()
 {
     PayAddressBookMonitor.Default.MonitorCallBack += books => {
         Application.Current.Dispatcher.Invoke(() =>
         {
             PayAddressBookMonitor.Default.Stop();
             UrlInfos.Clear();
             books.ForEach(x =>
             {
                 UrlInfos.Add(new UrlInfo(x));
             });
         });
     };
 }
Exemplo n.º 4
0
 void LoadUrls()
 {
     ReceiveAddressBookMonitor.Default.MonitorCallBack += accounts =>
     {
         ReceiveAddressBookMonitor.Default.Stop();
         Application.Current.Dispatcher.Invoke(() =>
         {
             UrlInfos.Clear();
             accounts.ForEach(x => UrlInfos.Add(new UrlInfo()
             {
                 Address = x.Address, Tag = x.Tag
             }));
         });
     };
 }
Exemplo n.º 5
0
        protected override void OnLoaded()
        {
            base.OnLoaded();

            BtnCommand             = new RelayCommand <string>(OnCommand);
            MouseDubleClickCommand = new RelayCommand <UrlInfo>(OnMouseDubleClick);
            RegeistMessenger <UrlInfo>(OnRequestCreateUrl);
            RegeistMessenger <PayUrlPageType>(OnGetRequest);
            PayAddressBookMonitor.Default.MonitorCallBack += books => {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    PayAddressBookMonitor.Default.Stop();
                    UrlInfos.Clear();
                    books.ForEach(x =>
                    {
                        UrlInfos.Add(new UrlInfo(x));
                    });
                });
            };
            LoadUrls();
            UrlInfos.CollectionChanged += (s, e) => { RaisePropertyChanged("UrlInfos"); };
        }