public LogicalView(IServiceProvider serviceProvider, object myContext) { var myDataContext = new LogicalViewModel(myContext as ISolutionBuilderViewModel); this.DataContext = myDataContext; this.InitializeComponent(); //this.DataContext = myContext; //var componentModel = ServiceProvider.GlobalProvider.GetService<SComponentModel, IComponentModel>(); //var container = componentModel.DefaultExportProvider as CompositionContainer; //if (container != null) //{ // container.ComposeExportedValue(this); //} }
public LogicalView(LogicalViewModel myContext) { this.DataContext = myContext; myContext.FocusOnViewRequested += (s, e) => { new System.Threading.Thread(() => { Dispatcher.Invoke(new Action(() => { var selectedNode = this.explorer.Focus(); this.explorer.Focus(); })); }).Start(); }; this.InitializeComponent(); }