public SegmentDetailsWindow(SegmentDetailsView view, SegmentDetailsViewModel model) { InitializeComponent(); this.DataContext = model; this.Content = view; this.Title = "Segment Details: " + model.Name; this.ShowActivated = true; }
protected void HandleSegmentDoubleClick(object sender, MouseButtonEventArgs e) { var selectedSegment = ((ListBoxItem)sender).Content as SegmentViewModel; SegmentDetailsViewModel segmentViewModel = new SegmentDetailsViewModel(selectedSegment.Segment); segmentViewModel.Name = string.Format( "{0}-{1}", this.photoViewModel.photo.title, this.photoViewModel.SegmentViews.IndexOf(selectedSegment) ); SegmentDetailsView view = new SegmentDetailsView(segmentViewModel); SegmentDetailsWindow window = new SegmentDetailsWindow(view, segmentViewModel); window.Show(); }
public SegmentDetailsView(SegmentDetailsViewModel viewModel) { InitializeComponent(); this.viewModel = viewModel; this.DataContext = viewModel; }