From 0800000f64b68ba761db69daeb9cbf4c402e8775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bouez?= <39953434+sebbouez@users.noreply.github.com> Date: Sun, 20 Aug 2023 16:22:14 +0200 Subject: [PATCH] new docs (first version) --- docs/404.html | 33 +++++++ docs/assets/404.html-60b35caa.js | 1 + docs/assets/404.html-76d21eea.js | 1 + .../assets/ApplicationWindow.html-9115126c.js | 1 + .../assets/ApplicationWindow.html-d6051307.js | 1 + .../FolderPickerTextbox.html-3cd65330.js | 2 + .../FolderPickerTextbox.html-ab0722f6.js | 1 + .../GenericPickerTextbox.html-0f50f56d.js | 1 + .../GenericPickerTextbox.html-832f12ca.js | 1 + .../MasterAccentSplitButton.html-1d4b84a1.js | 1 + .../MasterAccentSplitButton.html-71dfd961.js | 9 ++ .../assets/RibbonExtraButton.html-13adef65.js | 1 + .../assets/RibbonExtraButton.html-c2f4763f.js | 1 + docs/assets/SecondaryWindow.html-52f7b390.js | 1 + docs/assets/SecondaryWindow.html-7cba5db5.js | 1 + .../TabbedApplicationWindow.html-4ab63ce4.js | 1 + .../TabbedApplicationWindow.html-aec0a580.js | 1 + docs/assets/ThemedInputBox.html-076603e5.js | 7 ++ docs/assets/ThemedInputBox.html-d54e6ab2.js | 1 + docs/assets/ThemedMessageBox.html-e2bb5172.js | 1 + docs/assets/ThemedMessageBox.html-f133b34a.js | 15 ++++ .../ThemedOpenFileDialog.html-247af74d.js | 33 +++++++ .../ThemedOpenFileDialog.html-a55199f6.js | 1 + .../ThemedSaveFileDialog.html-89b58548.js | 1 + .../ThemedSaveFileDialog.html-a5d6aa11.js | 15 ++++ ...hemedSpecialDialogOptions.html-20afc891.js | 1 + ...hemedSpecialDialogOptions.html-e8611b06.js | 1 + .../acryliccontextmenu.html-5bbdb1ab.js | 1 + .../acryliccontextmenu.html-a33f9884.js | 10 +++ docs/assets/announcer.html-7a51f81c.js | 1 + docs/assets/announcer.html-bc04130d.js | 30 +++++++ docs/assets/app-e0605d3e.js | 10 +++ docs/assets/back-to-top-8efcbe56.svg | 1 + docs/assets/getstarted.html-18c55845.js | 33 +++++++ docs/assets/getstarted.html-604d8647.js | 1 + docs/assets/index.html-0d5731de.js | 1 + docs/assets/index.html-878c2ead.js | 1 + docs/assets/menubar.html-736f29e5.js | 15 ++++ docs/assets/menubar.html-d4e52ee9.js | 1 + docs/assets/menubarwindow-7ec05645.png | Bin 0 -> 382430 bytes .../omnibar-search-provider.html-5e6dc7b7.js | 49 +++++++++++ .../omnibar-search-provider.html-81d8f871.js | 1 + docs/assets/ribbonbarwindow-d80a3311.png | Bin 0 -> 547177 bytes docs/assets/style-c2e86e58.css | 1 + docs/classes/ThemedSpecialDialogOptions.html | 33 +++++++ docs/controls/FolderPickerTextbox.html | 34 ++++++++ docs/controls/GenericPickerTextbox.html | 33 +++++++ docs/controls/MasterAccentSplitButton.html | 41 +++++++++ docs/controls/RibbonExtraButton.html | 33 +++++++ docs/controls/acryliccontextmenu.html | 42 +++++++++ docs/controls/announcer.html | 62 ++++++++++++++ docs/controls/menubar.html | 47 ++++++++++ docs/dialogs/ThemedInputBox.html | 39 +++++++++ docs/dialogs/ThemedMessageBox.html | 47 ++++++++++ docs/dialogs/ThemedOpenFileDialog.html | 65 ++++++++++++++ docs/dialogs/ThemedSaveFileDialog.html | 47 ++++++++++ docs/getstarted.html | 65 ++++++++++++++ docs/howto/omnibar-search-provider.html | 81 ++++++++++++++++++ docs/index.html | 34 +++++++- docs/windows/ApplicationWindow.html | 33 +++++++ docs/windows/SecondaryWindow.html | 33 +++++++ docs/windows/TabbedApplicationWindow.html | 33 +++++++ 62 files changed, 1091 insertions(+), 1 deletion(-) create mode 100644 docs/404.html create mode 100644 docs/assets/404.html-60b35caa.js create mode 100644 docs/assets/404.html-76d21eea.js create mode 100644 docs/assets/ApplicationWindow.html-9115126c.js create mode 100644 docs/assets/ApplicationWindow.html-d6051307.js create mode 100644 docs/assets/FolderPickerTextbox.html-3cd65330.js create mode 100644 docs/assets/FolderPickerTextbox.html-ab0722f6.js create mode 100644 docs/assets/GenericPickerTextbox.html-0f50f56d.js create mode 100644 docs/assets/GenericPickerTextbox.html-832f12ca.js create mode 100644 docs/assets/MasterAccentSplitButton.html-1d4b84a1.js create mode 100644 docs/assets/MasterAccentSplitButton.html-71dfd961.js create mode 100644 docs/assets/RibbonExtraButton.html-13adef65.js create mode 100644 docs/assets/RibbonExtraButton.html-c2f4763f.js create mode 100644 docs/assets/SecondaryWindow.html-52f7b390.js create mode 100644 docs/assets/SecondaryWindow.html-7cba5db5.js create mode 100644 docs/assets/TabbedApplicationWindow.html-4ab63ce4.js create mode 100644 docs/assets/TabbedApplicationWindow.html-aec0a580.js create mode 100644 docs/assets/ThemedInputBox.html-076603e5.js create mode 100644 docs/assets/ThemedInputBox.html-d54e6ab2.js create mode 100644 docs/assets/ThemedMessageBox.html-e2bb5172.js create mode 100644 docs/assets/ThemedMessageBox.html-f133b34a.js create mode 100644 docs/assets/ThemedOpenFileDialog.html-247af74d.js create mode 100644 docs/assets/ThemedOpenFileDialog.html-a55199f6.js create mode 100644 docs/assets/ThemedSaveFileDialog.html-89b58548.js create mode 100644 docs/assets/ThemedSaveFileDialog.html-a5d6aa11.js create mode 100644 docs/assets/ThemedSpecialDialogOptions.html-20afc891.js create mode 100644 docs/assets/ThemedSpecialDialogOptions.html-e8611b06.js create mode 100644 docs/assets/acryliccontextmenu.html-5bbdb1ab.js create mode 100644 docs/assets/acryliccontextmenu.html-a33f9884.js create mode 100644 docs/assets/announcer.html-7a51f81c.js create mode 100644 docs/assets/announcer.html-bc04130d.js create mode 100644 docs/assets/app-e0605d3e.js create mode 100644 docs/assets/back-to-top-8efcbe56.svg create mode 100644 docs/assets/getstarted.html-18c55845.js create mode 100644 docs/assets/getstarted.html-604d8647.js create mode 100644 docs/assets/index.html-0d5731de.js create mode 100644 docs/assets/index.html-878c2ead.js create mode 100644 docs/assets/menubar.html-736f29e5.js create mode 100644 docs/assets/menubar.html-d4e52ee9.js create mode 100644 docs/assets/menubarwindow-7ec05645.png create mode 100644 docs/assets/omnibar-search-provider.html-5e6dc7b7.js create mode 100644 docs/assets/omnibar-search-provider.html-81d8f871.js create mode 100644 docs/assets/ribbonbarwindow-d80a3311.png create mode 100644 docs/assets/style-c2e86e58.css create mode 100644 docs/classes/ThemedSpecialDialogOptions.html create mode 100644 docs/controls/FolderPickerTextbox.html create mode 100644 docs/controls/GenericPickerTextbox.html create mode 100644 docs/controls/MasterAccentSplitButton.html create mode 100644 docs/controls/RibbonExtraButton.html create mode 100644 docs/controls/acryliccontextmenu.html create mode 100644 docs/controls/announcer.html create mode 100644 docs/controls/menubar.html create mode 100644 docs/dialogs/ThemedInputBox.html create mode 100644 docs/dialogs/ThemedMessageBox.html create mode 100644 docs/dialogs/ThemedOpenFileDialog.html create mode 100644 docs/dialogs/ThemedSaveFileDialog.html create mode 100644 docs/getstarted.html create mode 100644 docs/howto/omnibar-search-provider.html create mode 100644 docs/windows/ApplicationWindow.html create mode 100644 docs/windows/SecondaryWindow.html create mode 100644 docs/windows/TabbedApplicationWindow.html diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..e90a4fd --- /dev/null +++ b/docs/404.html @@ -0,0 +1,33 @@ + + +
+ + + + + +Namespace: Coho.UI.Controls.Textboxes
, inherits from TextBox
The FolderPickerTextbox
is a text box that contains a button that allows the user to open the native folder picker dialog to select a folder.
Type: string
The value of the text box.
Type:EventHandler<string>
This event fires when the users selects a path in the folder picker dialog. The string
argument is the selected path.
<textboxes:FolderPickerTextbox x:Name="TbDefaultFolder" Width="240" />
+
Namespace: Coho.UI.Controls.Buttons
, inherits from Button
The MasterAccentSplitButton
is a button that it usually used to start an activity in the application. For example, in Microsoft Office, you can find them in the Backstage view, to create new documents. It's a split button that uses the AccentColor
resource as background. The text uses a semi bold weight. It supports an icon (brush
resource).
Type: object
The content of the dropdown menu.
Type: brush
The icon to display in the button.
Type: string
The text to display in the button.
None.
Type: RoutedEventHandler
Occurs when the user clicks the left part of the button.
<buttons:MasterAccentSplitButton Text="Create new" Icon="{DynamicResource IconMagic}" Click="MasterAccentSplitButton_Click">
+ <buttons:MasterAccentSplitButton.DropDownContent>
+ <StackPanel>
+ <MenuItem Header="Item 1" />
+ <MenuItem Header="Item 2" />
+ </StackPanel>
+ </buttons:MasterAccentSplitButton.DropDownContent>
+</buttons:MasterAccentSplitButton>
+
The ThemedInputBox
is a dialog that provides a message and a TextBox
so that the user can enter text.
None.
Shows a modal dialog using the current theme. Returns a string?
.
If the returned value is null
, it means that the user selected the Cancel button or closed the dialog.
string
message : The message to display.string
title : The title of the dialog.string
defaultValue : The text to write in the TextBox
by default when the dialog opens.Shows a modal dialog using the current theme. Returns a string?
.
If the returned value is null
, it means that the user selected the Cancel button or closed the dialog.
string
message : The message to display.string
title : The title of the dialog.string
defaultValue : The text to write in the TextBox
by default when the dialog opens.string
defaultButtonText : The text to display in the default button.string
secondaryButtonText : The text to in the the secondary button.Shows a modal dialog using the current theme. Returns a MessageBoxResult
that represents the choice of the user.
This method can be used to override the default texts and provide a better UX while still using the default framework components.
This method should be used with the MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
arguments. The Yes button will be replaced with the defaultButtonText value, and the No button will be replaced with the secondaryButtonText.
string
message : The message to display.string
title : The title of the dialog.Window
owner : The window that owns the dialog; used for the modal behavior.string
defaultValue : The text to write in the TextBox
by default when the dialog opens.string
defaultButtonText : The text to display in the default button.string
secondaryButtonText : The text to in the the secondary button.None.
This example shows how to use the ThemedInputBox
from C# and handle the result.
string? value = ThemedInputBox.Show("Please provide name for this folder:", "Rename folder", this);
+
+if (!string.IsNullOrEmpty(value))
+{
+ // some code to rename a folder
+}
+
The ThemedMessageBox
is a dialog that replaces the default MessageBox
using the current theme.
None.
Shows a modal dialog using the current theme. Returns a MessageBoxResult
that represents the choice of the user.
string
message : The message to displaystring
title : The title of the dialogMessageBoxButton
button : The buttons to displayShows a modal dialog using the current theme. Returns a MessageBoxResult
that represents the choice of the user.
This method can be used to override the default texts and provide a better UX while still using the default framework components.
This method should be used with the MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
arguments. The Yes button will be replaced with the defaultButtonText value, and the No button will be replaced with the secondaryButtonText.
string
message : The message to displaystring
title : The title of the dialogMessageBoxButton
: The buttons to displaystring
defaultButtonText : The text to display in the default button (the Yes button when using MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
)string
secondaryButtonText : The text to in the the secondary button (the No button when using MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
)Shows a modal dialog using the current theme. Returns a MessageBoxResult
that represents the choice of the user.
This method can be used to override the default texts and provide a better UX while still using the default framework components.
This method should be used with the MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
arguments. The Yes button will be replaced with the defaultButtonText value, and the No button will be replaced with the secondaryButtonText.
string
message : The message to displayWindow
owner: The Window that will own the dialogstring
title : The title of the dialogMessageBoxButton
: The buttons to displaystring
defaultButtonText : The text to display in the default button (the Yes button when using MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
)string
secondaryButtonText : The text to in the the secondary button (the No button when using MessageBoxButton.YesNoCancel
or MessageBoxButton.YesNo
)None.
This example shows how to use the ThemedMessageBox
from C# and handle the result.
MessageBoxResult quest = ThemedMessageBox.Show("Do you want to save changes?", "Save changes", MessageBoxButton.YesNoCancel);
+
+switch (quest)
+{
+ case MessageBoxResult.Yes:
+ // Yes button was clicked
+ break;
+ case MessageBoxResult.No:
+ // No button was clicked
+ break;
+ case MessageBoxResult.Cancel:
+ // Cancel button was clicked
+ break;
+}
+
The ThemedOpenFileDialog
is a dialog that replaces the default OpenFileDialog
using the current theme.
None.
Opens a dialog that lets the user browse the computer to open an existing file. Returns a string?
.
When the result is null, it means that the user has closed the dialog without selecting a file.
string
title : The title of the dialogDictionary<string, string>
fileTypes : The supported extensionsWindow
owner: The Window that will own the dialogOpens a dialog that lets the user browse the computer to open an existing file. Returns a string?
.
When the result is null, it means that the user has closed the dialog without selecting a file.
None.
This example shows how to localize the ThemedOpenFileDialog
texts.
public MainWindow()
+{
+ InitializeComponent();
+ Loaded += OnLoaded;
+}
+
+private void OnLoaded(object sender, RoutedEventArgs e)
+{
+ // Set Coho.UI Texts resources from your own localization resources
+ GenericText.Cancel = Localization.Resources.GenericCancel;
+ DialogsText.Open = Localization.Resources.GenericOpen;
+ DialogsText.FileName = Localization.Resources.GenericFileName;
+ DialogsText.FileType = Localization.Resources.GenericFileType;
+
+ ...
+}
+
This example shows how to use the ThemedOpenFileDialog
from C# and handle the result.
ThemedSpecialDialogOptions options = new ThemedSpecialDialogOptions()
+{
+ FileTypes =
+ {
+ {"All supported file types (*.md;*.pwdp)", "*.md;*.pwdp"},
+ {"Markdown file (*.md)", "*.md"},
+ {"PowerDocs Project file (*.pwdp)", "*.pwdp"}
+ }
+};
+
+string? filePath = ThemedOpenFileDialog.Show(Localization.Resources.MenuOpen, options, this);
+
+if (!string.IsNullOrEmpty(filePath))
+{
+ // open the selected file in your application
+}
+
The ThemedSaveFileDialog
is a dialog that replaces the default SaveFileDialog
using the current theme.
None.
Shows a modal dialog using the current theme. Returns a MessageBoxResult
that represents the choice of the user.
string
message : The message to displaystring
title : The title of the dialogMessageBoxButton
button : The buttons to displayNone.
This example shows how to use the ThemedMessageBox
from C# and handle the result.
string? filePath = ThemedOpenFileDialog.Show("Open file",
+ new Dictionary<string, string>()
+ {
+ {"All supported file types (*.md;*.pwdp)", "*.md;*.pwdp"},
+ {"Markdown file (*.md)", "*.md"},
+ {"PowerDocs Project file (*.pwdp)", "*.pwdp"}
+ },
+ "",
+ this);
+
+if (!string.IsNullOrEmpty(filePath))
+{
+ // open the selected file in your application
+}
+
Type: int
Default value: 650
The DefaultHeight property defines the initial height of the dialog in pixels.
Type: int
Default value: 920
The DefaultWidth property defines the initial width of the dialog in pixels.
Type: Dictionary<string, string>
Default value: default
The FileTypes property defines the extensions that are supported by the dialog.
Type: string
Default value: String.Empty
The InitialDirectory property defines the first folder to show when the dialog is opened.
Type: bool
Default value: true
The ShowDefaultSpecialFolders property defines if the special folders (Documents, Images, Videos...) section will be displayed. This property has no effect if the ShowNavigationPane
property is set to false
.
Type: bool
Default value: true
The ShowNavigationPane property defines if the navigation pane (on the left side) will be displayed.
None.
None.
',17);function u(g,b){const t=o("RouterLink");return d(),r("div",null,[c,e("p",null,[a("This class is used to configure the behavior of the "),s(t,{to:"/dialogs/ThemedOpenFileDialog.html"},{default:h(()=>[p]),_:1}),a(" dialog.")]),f])}const T=i(l,[["render",u],["__file","ThemedSpecialDialogOptions.html.vue"]]);export{T as default}; diff --git a/docs/assets/acryliccontextmenu.html-5bbdb1ab.js b/docs/assets/acryliccontextmenu.html-5bbdb1ab.js new file mode 100644 index 0000000..ee39fa2 --- /dev/null +++ b/docs/assets/acryliccontextmenu.html-5bbdb1ab.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-743236a8","path":"/controls/acryliccontextmenu.html","title":"The AcrylicContextMenu control","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Properties","slug":"properties","link":"#properties","children":[]},{"level":2,"title":"Methods","slug":"methods","link":"#methods","children":[]},{"level":2,"title":"Events","slug":"events","link":"#events","children":[]},{"level":2,"title":"Examples","slug":"examples","link":"#examples","children":[]}],"git":{},"filePathRelative":"controls/acryliccontextmenu.md"}');export{e as data}; diff --git a/docs/assets/acryliccontextmenu.html-a33f9884.js b/docs/assets/acryliccontextmenu.html-a33f9884.js new file mode 100644 index 0000000..69b3e82 --- /dev/null +++ b/docs/assets/acryliccontextmenu.html-a33f9884.js @@ -0,0 +1,10 @@ +import{_ as e,o as t,c as n,e as a}from"./app-e0605d3e.js";const o={},r=a(`Namespace: Coho.UI.Controls.Menus
, inherits from ContextMenu
The AcrylicContextMenu
uses the Acrylic texture on Windows 11. It will automatically fallback to a legacy style when it is not available.
None.
None.
None.
This example shows how to attach an AcrylicContextMenu
on a Border
.
<Border Width="150" Height="150" Background="Silver">
+ <Border.ContextMenu>
+ <menus:AcrylicContextMenu>
+ <MenuItem Header="Test 1"/>
+ <MenuItem Header="Test 2"/>
+ <MenuItem Header="Test 3"/>
+ </menus:AcrylicContextMenu>
+ </Border.ContextMenu>
+</Border>
+
Namespace: Coho.UI.Controls.Announcer
The Announcer
is a slider that allows you to specify the number of items per page and the template of bound items.
Type: DataTemplate
The AnnounceTemplate property defines the template to be used to display items in the slider.
Type: DependencyProperty, bool
The IsLoadingContent property is used to hide control content and display a LoadingRing
to indicate that content is being loaded.
Type: DependencyProperty, int
The ItemsPerView property is used to set the number of items per page. When there are more items than this value, the user can slide content using the arrows on the top right of the control.
Type: IEnumerable<object>
The ItemsSource property is used to set the collection of objects to display.
Type: DependencyProperty, string
The Label property is used to set the text displayed at the top of the Announcer
control.
None.
None.
This example shows how to set the AnnounceTemplate
property from Xaml.
<announcer:Announcer AnnouncesAreaMargin="0,8,0,0" Margin="0,8" ItemsPerView="4"
+ x:Name="AnnouncesPresenter" MinHeight="200">
+ <announcer:Announcer.AnnounceTemplate>
+ <DataTemplate>
+ <Border x:Name="BdrContainer" CornerRadius="6">
+ <StackPanel>
+ <TextBlock Text="{Binding Title}" FontWeight="SemiBold" FontSize="14"
+ TextWrapping="Wrap" Margin="0,0,10,0" />
+ <TextBlock Text="{Binding Content}"
+ TextWrapping="Wrap" Margin="0,0,10,0" />
+ </StackPanel>
+ </Border>
+ </DataTemplate>
+ </announcer:Announcer.AnnounceTemplate>
+</announcer:Announcer>
+
This example shows how to load data from code-behind and set the control in loading mode.
// Put the control in Loading mode, it shows a loading ring
+AnnouncesPresenter.IsLoadingContent = true;
+
+OnlineContentService.GetItems().ContinueWith(r =>
+{
+ // Stop the loading mode to show fetched items
+ AnnouncesPresenter.IsLoadingContent = false;
+ AnnouncesPresenter.ItemsSource = r.Result;
+
+}, TaskScheduler.FromCurrentSynchronizationContext());
+
This example shows how to bind a localized string to the Label
property in Xaml.
<announcer:Announcer AnnouncesAreaMargin="0,8,0,0" Margin="0,8" ItemsPerView="4"
+ x:Name="AnnouncesPresenter" MinHeight="200"
+ Label="{x:Static localization:Resources.OnlineResourcesDescription}">
+</announcer:Announcer>
+
Have a look at the sample application, the file
App.xaml
contains all the required resources to make it work nicely. Just change the brushes to make it yours.
You must define the Font Family and Font size to use.
FontFamily
AppFont: Defines the font to use in the UI.system:Double
AppFontSize: Defines the font size to use in the UI.Example:
<FontFamily x:Key="AppFont">Segoe UI Variable Display,Segoe UI</FontFamily>
+<system:Double x:Key="AppFontSize">14</system:Double>
+
You must define your color theme using specified resource names.
Color
ChromeBorderActiveColor: Defines the color of the window border when it is active.Brush
AccentColor: Defines the accent color to be used on various UI elements.Brush
AccentColorDark: Defines the darker accent color to be used on various UI elements (used for hover state for example).Brush
AccentColorDarker: Defines the even darker accent color to be used on various UI elements (used for pressed state for example).Brush
IconsAccentColor: Defines the color to be used in Coho.UI bundled isons.Brush
AccentButtonBorderColor: Defines the brush to be used for border on buttons that use the PrimaryButton
style.Example:
<Color x:Key="ChromeBorderActiveColor">#038387</Color>
+<LinearGradientBrush x:Key="AccentButtonBorderColor" StartPoint="0,0.9" EndPoint="0,1">
+ <GradientStop Color="#038387" Offset="0" />
+ <GradientStop Color="#026163" Offset="1" />
+</LinearGradientBrush>
+
+<SolidColorBrush x:Key="AccentColor" Color="#038387" />
+<SolidColorBrush x:Key="TitleBarAccentedColor" Color="#038387" />
+<SolidColorBrush x:Key="IconsAccentColor" Color="#038387" />
+<SolidColorBrush x:Key="AccentColorDark" Color="#026163" />
+<SolidColorBrush x:Key="AccentColorDarker" Color="#024D4F" />
+
public MainWindow()
+{
+ InitializeComponent();
+
+ // Example: Register a custom resource file to be used only in Dark mode
+ // For example, your own implementation of Dark Theme
+ UIController.RegisterThemedMergedResourceName("/DarkTheme.xaml", ThemeScheme.Dark);
+
+ // Example: Register a custom resource file to be used only in Light mode
+ // For example, your own implementation of Light Theme
+ UIController.RegisterThemedMergedResourceName("/LightTheme.xaml", ThemeScheme.Light);
+
+ // Example: Register a custom resource file to be loaded in ANY mode (null in argument 2)
+ // The resource will be reloaded when the user switches the theme to ensure dynamic resources are correct
+ UIController.RegisterThemedMergedResourceName("/Styles/Icons.xaml", null);
+
+ // This line is important, we want the app to start with Ligth theme
+ UIController.Init(ThemeScheme.Light);
+}
+
The V2 contains a lot of new things, but also breaking changes. Please read this page before you update your projects.
Icon
property of MenuItem
is now supposed to be a Brush
object.Namespace: Coho.UI.Controls.Menus
Type: List<UIElement>
Type: List<UIElement>
Type: Bool
Type: Bool
Type: Bool
Returns the identifier of the provided MenuItem
. It is used to memorize the Quick Access Toolbar commands for example.
MenuItem
cmd: The menu item you want to get the unique identifier. MenuItem
must have a Name property set to work properly.NullReferenceException
: Occurs when the provided cmd has no FrameworkElement.Name
property.None.
<menus:MenuBar ShowQAT="True" x:Name="MainMenuBar">
+
+ <menus:MenuBar.ExtraButtons>
+ <ui3:RibbonExtraButton Text="Publish"
+ IsPrimary="true" Icon="{x:Null}"
+ Padding="6,4"
+ Margin="8,0,0,0" />
+ </menus:MenuBar.ExtraButtons>
+
+ <MenuItem Header="{x:Static localization:Resources.MenuFile}">
+ <MenuItem Header="{x:Static localization:Resources.MenuNew}">
+ </MenuItem>
+ </MenuItem>
+</menus:MenuBar>
+