예제 #1
0
 private void loadModel(MainSystemNoticeModel model)
 {
     if (model.EventType == EventEnum.RefreshAuth)
     {
         RefreshAuth?.Invoke();
         return;
     }
     if (model.EventType == EventEnum.NavHome)
     {
     }
 }
예제 #2
0
        private void LoadNotice(MainSystemNoticeModel model)
        {
            Action loadCloseAction = () =>
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    if (loadWindow != null)
                    {
                        loadWindow.Close();
                        loadWindow = null;
                    }
                }));
            };

            if (model.EventType == EventEnum.StartLoad)
            {
                if (loadWindow == null)
                {
                    loadWindow = new LoadWindow();
                    Task.Factory.StartNew(new Action(async() =>
                    {
                        await Task.Delay(LoadMaxTime * 1000);
                        loadCloseAction();
                    }));
                    Dispatcher.BeginInvoke(new Action(() =>
                    {
                        loadWindow.ShowDialog();
                    }));
                }
                return;
            }
            if (model.EventType == EventEnum.EndLoad)
            {
                Thread.Sleep(1000);
                loadCloseAction();
            }
        }