private void QuestSelect_Click(object sender, RoutedEventArgs e) { AssetPicker_Window apw = new AssetPicker_Window(typeof(GameQuestAsset)); apw.Owner = MainWindow.Instance; if (apw.ShowDialog() == true) { txtBoxQuestID.Value = apw.SelectedAsset.id; } }
internal static MenuItem CreateSelectAssetButton(Type assetType, Action <GameAsset> action, string key, PackIconMaterialKind icon, params AssetFilter[] filters) { MenuItem b = new MenuItem() { Header = LocalizationManager.Current.Interface[key] }; b.Click += (object sender, RoutedEventArgs e) => { AssetPicker_Window apw = new AssetPicker_Window(assetType, filters); apw.Owner = MainWindow.Instance; if (apw.ShowDialog() == true) { action.Invoke(apw.SelectedAsset); } }; b.Icon = new PackIconMaterial() { Kind = icon }; (b.Icon as PackIconMaterial).SetResourceReference(PackIconMaterial.ForegroundProperty, "AccentColor"); return(b); }