/// <summary> /// Initializes a new instance of the <see cref="TranscriptionUserControl" /> class. /// </summary> /// <param name="transcriptionId">The transcription identifier.</param> /// <param name="expander">The expander.</param> public Transcription(int transcriptionId, WellKnownExpander expander) { InitializeComponent(); DataContext = new TranscriptionUiModel(); CollectionComboBox.ItemsSource = App.BaseUserControl.ObservableCollection; TranscriptionId = transcriptionId; if (TranscriptionId > 0) { ViewTranscription(); switch (expander) { case WellKnownExpander.General: //Expander_Expanded(GeneralExpander, null); break; case WellKnownExpander.Transcript: //Expander_Expanded(TranscriptExpander, null); break; case WellKnownExpander.Media: // Expander_Expanded(MediaExpander, null); break; case WellKnownExpander.Metadata: //Expander_Expanded(MetadataExpander, null); break; case WellKnownExpander.Supplemental: //Expander_Expanded(SupplementalExpander, null); break; default: break; } } ControlsVisibility(); Loaded += (s, args) => { PopulateIntializeView(); }; }
private void LoadBrowseData(int id, WellKnownExpander expader) { //BackToListButton.Visibility = Visibility.Visible; // MainGrid.Visibility = Visibility.Hidden; // cc.Content = new Transcription(id, expader); Window window = new Window { Title = "My User Control Dialog", Content = new Transcription(id, expader), Owner = Application.Current.MainWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner, Height = SystemParameters.PrimaryScreenHeight * .85, Width = SystemParameters.PrimaryScreenWidth * .85, }; window.ShowDialog(); }
/// <summary> /// Handles the MouseDoubleClick event of the TranscriptionQueueListView control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="MouseButtonEventArgs" /> instance containing the event data.</param> void BrowseListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { UIElement clicked = e.OriginalSource as UIElement; string name = ((FrameworkElement)clicked).Name; if (clicked != null && !string.IsNullOrEmpty(name)) { string[] words = name.Split('_'); if (words.Length > 1) { WellKnownExpander expader = (WellKnownExpander)Enum.Parse(typeof(WellKnownExpander), words[1]); TranscriptionModel itemTranscriptionModel = ((FrameworkElement)e.OriginalSource).DataContext as TranscriptionModel; LoadBrowseData(itemTranscriptionModel.Id, expader); } } }