コード例 #1
0
 public void SwitchApi()
 {
     SettingManager.ApiVersion = SettingManager.ApiVersion == 3 ? 2 : 3;
     MainState        = new FaceStateViewModel();
     AppClient.Client =
         SettingManager.ApiVersion == 2 ? v2Client : v3Client;
     NotifyOfPropertyChange(() => ApiSwitchCaption);
 }
コード例 #2
0
 private void HandleFileOpen(string fileName)
 {
     try
     {
         MainState = new FaceStateViewModel(fileName);
     }
     catch { }
 }
コード例 #3
0
        public void FaceStateDoubleClick(MouseButtonEventArgs e)
        {
            FaceStateViewModel model = ((e.Source as ListView)?.SelectedItem as FaceStateViewModel);

            if (model != null && model != MainState)
            {
                if (!model.Loading && !model.Error)
                {
                    MainState = model;
                }
            }
        }
コード例 #4
0
        public void MouseLeaveForDrag(FaceStateViewModel source, MouseEventArgs e)
        {
            if (Loading || Error || source == null || e == null)
            {
                return;
            }

            if (e.LeftButton == MouseButtonState.Pressed)
            {
                FaceAppHelpers.DragCopyFile((DependencyObject)e.Source, source.FilePath);
            }
        }
コード例 #5
0
 public void FaceStateSelectionChanged(SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count == 1)
     {
         FaceStateViewModel model = e.AddedItems[0] as FaceStateViewModel;
         if (model != null)
         {
             if (!model.Loading && !model.Error)
             {
                 PreviewState = model;
             }
         }
     }
 }
コード例 #6
0
        public MainViewModel()
        {
            MainState   = new FaceStateViewModel();
            DisplayName = "FaceApp Desktop";

            v2Client.ErrorOccurred += (sender, s) =>
                                      Dispatcher.CurrentDispatcher.Invoke(() =>
                                                                          Status = s);

            v3Client.ErrorOccurred += (sender, s) =>
                                      Dispatcher.CurrentDispatcher.Invoke(() =>
                                                                          Status = s);

            AppClient.Client =
                SettingManager.ApiVersion == 2 ? v2Client : v3Client;
        }
コード例 #7
0
        public FaceStateViewModel(FaceStateViewModel parent, string type)
        {
            ParentState = parent;
            Type        = type;
            Loaded      = false;
            Filtered    = true;
            Uploaded    = false;

            if (SettingManager.PreLoad)
            {
                Loading = true;
            }
            else
            {
                Paused = true;
            }
        }
コード例 #8
0
 public MainViewModel()
 {
     MainState   = new FaceStateViewModel();
     DisplayName = "FaceApp Desktop";
 }
コード例 #9
0
 public FaceStateViewModel(FaceStateViewModel parent, string type)
 {
     ParentState = parent;
     Type        = type;
     Loading     = true;
 }