// Constructor public NewTemplateDialog(TemplateModel existModel = null) { // Create the new ViewModel, with possible existing Model as well ViewModel = new TemplateEditorViewModel(existModel); // Added because this dialog just likes to stay on Dark Theme otherwise RequestedTheme = (Window.Current.Content as FrameworkElement).RequestedTheme; this.InitializeComponent(); // Set the title of the dialog // #TODO Set this with proper ResourceDictionaries if (ViewModel.ExistingTemplate == null) { // Set as New Template tblDialogTitle.Text = "New template"; } else if (ViewModel.ExistingTemplate.TemplateId >= 1) { // Set as Edit Template tblDialogTitle.Text = "Edit template"; } else if (ViewModel.ExistingTemplate.TemplateId == -1) { // Set as Import Template tblDialogTitle.Text = "Import template"; } }
public void MakePreview(Skin skin) { TemplateEditorViewModel vm = DataContext as TemplateEditorViewModel; vm.TargetSkin = skin; vm.PreviewText = Helper.ApplyForumTemplate(textEditor.Text, vm.TargetSkin); }