public DicomPanelView() { InitializeComponent(); DicomPanelViewModel vm = (DicomPanelViewModel)DataContext; vm.Canvas = OverlayCanvas; vm.OnSizeChanged(this.ActualWidth, this.ActualHeight); this.Loaded += DicomPanelView_Loaded; this.SizeChanged += WorldViewControl_SizeChanged; }
private void DicomPanelView_Loaded(object sender, RoutedEventArgs e) { DicomPanelViewModel vm = (DicomPanelViewModel)DataContext; vm.OnSizeChanged(this.ActualWidth, this.ActualHeight); }