public void SwitchApi() { SettingManager.ApiVersion = SettingManager.ApiVersion == 3 ? 2 : 3; MainState = new FaceStateViewModel(); AppClient.Client = SettingManager.ApiVersion == 2 ? v2Client : v3Client; NotifyOfPropertyChange(() => ApiSwitchCaption); }
private void HandleFileOpen(string fileName) { try { MainState = new FaceStateViewModel(fileName); } catch { } }
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; } } }
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); } }
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; } } } }
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; }
public FaceStateViewModel(FaceStateViewModel parent, string type) { ParentState = parent; Type = type; Loaded = false; Filtered = true; Uploaded = false; if (SettingManager.PreLoad) { Loading = true; } else { Paused = true; } }
public MainViewModel() { MainState = new FaceStateViewModel(); DisplayName = "FaceApp Desktop"; }
public FaceStateViewModel(FaceStateViewModel parent, string type) { ParentState = parent; Type = type; Loading = true; }