private void OnCreateVariantRequested(object sender, CreateVariantEventArgs e) { var variation = CreateVariantWindow.RequestVariant(this, this.pvm.Property); if (variation != null) { e.Variation = Task.FromResult(variation); } }
internal static PropertyVariation RequestVariant(FrameworkElement owner, IPropertyInfo property) { Window hostWindow = Window.GetWindow(owner); var w = new CreateVariantWindow(owner.Resources.MergedDictionaries, property) { Owner = hostWindow, }; if (!w.ShowDialog() ?? false) { return(null); } var vm = (CreateVariantViewModel)w.DataContext; return(vm.Variation); }