Skip to content

Commit 7961e91

Browse files
committed
Merge branch 'release/v24.1.4' into main
2 parents 647678c + d4c2fc1 commit 7961e91

File tree

74 files changed

+2456
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2456
-167
lines changed

Documentation/topics/bars/configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ All of the Bars controls have been built from the ground up to support both XAML
1212
1313
## XAML Configuration
1414

15-
All Bars controls can be defined directly in XAML and are designed to support common WPF usage scenarios like data binding.
15+
All Bars controls can be defined directly in XAML and are designed to support common usage scenarios like data binding.
1616

1717
### Pros
1818

19-
XAML is familiar to most WPF developers and popular IDEs like Visual Studio provide designers that make it easy to visualize the run-time appearance of controls as their XAML is written. Newer IDEs even support hot reload of XAML definitions to modify a control at run-time and immediately see the impact of a change. Getting started with XAML can be very quick and the entire control definition can often be contained in a single file.
19+
XAML is familiar to most @@PlatformTitle developers and popular IDEs like Visual Studio provide designers that make it easy to visualize the run-time appearance of controls as their XAML is written. Newer IDEs even support hot reload of XAML definitions to modify a control at run-time and immediately see the impact of a change. Getting started with XAML can be very quick and the entire control definition can often be contained in a single file.
2020

2121
### Cons
2222

2323
Some controls are used in multiple locations, and using XAML will typically require controls to be redefined everywhere they are used. For instance, a button that appears on a ribbon tab, a quick access toolbar, and a context menu might have to be defined three times. Care must be taken to ensure the same `Key` value is used for each control instance and common UI-centric properties like labels, tooltips, and icons will need to be repeated and synchronized between each control instance.
2424

2525
## MVVM Configuration
2626

27-
MVVM is an extremely popular pattern used for WPF and one that is fully supported by Bars controls.
27+
MVVM is an extremely popular pattern used for @@PlatformTitle and one that is fully supported by Bars controls.
2828

2929
### Pros
3030

@@ -39,7 +39,7 @@ In general, the MVVM pattern also has its own inherent benefits, like unit testi
3939

4040
### Cons
4141

42-
The MVVM pattern is naturally more complex than working directly in XAML and involves multiple view model classes, template selectors, styles, and other classes working together to achieve the desired result. Our companion [MVVM Library](mvvm-support.md) and extensive samples can get developers moving quickly, but configuring at least one central repository of view models for controls will be necessary. Testing design changes usually requires running the application since a visual designer may not be able to support the MVVM configuration at design-time.
42+
The MVVM pattern is naturally more complex than working directly in XAML and involves multiple view model classes, template selectors, @if (avalonia) { themes, }@if (wpf) { styles, } and other classes working together to achieve the desired result. Our companion [MVVM Library](mvvm-support.md) and extensive samples can get developers moving quickly, but configuring at least one central repository of view models for controls will be necessary. Testing design changes usually requires running the application since a visual designer may not be able to support the MVVM configuration at design-time.
4343

4444
Getting started with MVVM will typically take longer than XAML even if there are long-term efficiency gains. For simple projects, MVVM benefits may not be worth the extra effort.
4545

Documentation/topics/bars/controls/auto-generation.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ order: 210
77

88
Many controls have `Key`, `Label`, and `KeyTipText` properties. Since these properties are closely related, controls can auto-generate a `Label` value based on the `Key` if no other `Label` has been explicitly set. Likewise, a `KeyTipText` value can be auto-generated from a `Label` if no other `KeyTipText` has been expicitly set.
99

10+
@if (wpf) {
1011
Other contextual values (like certain `ICommand` types) can also be used when auto-generating property values.
12+
}
1113

1214
This time-saving feature helps reduce the need to specify many `Label` and `KeyTipText` values, except in scenarios where a customized value is necessary!
1315

@@ -48,13 +50,17 @@ Exception for the first word in "camelCase", all recognized words will use the c
4850
4951
### Label from Command
5052

53+
@if (avalonia) {
54+
The default [LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator.FromCommand*) method implementation will always return `null`, but this method can be overridden by derived classes to automatically provide labels for known commands.
55+
}
56+
@if (wpf) {
5157
The default [LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator.FromCommand*) method implementation will analyze an `ICommand` to determine the best label.
5258
- The `ApplicationCommands.NotACommand` command is ignored and will always return a value of `null`.
5359
- Any other `RoutedUICommand` will use the `RoutedUICommand.Text` property as the label.
5460
- Any `RoutedCommand` will use the `RoutedCommand.Name` property as the label.
5561

56-
5762
A value of `null` will be returned if a label could not be determined from the command.
63+
}
5864

5965
## Key Tip Generation
6066

@@ -87,11 +93,16 @@ A value of `null` will be returned if a value for key tip text could not be dete
8793

8894
### Key Tip from Command
8995

96+
@if (avalonia) {
97+
The default [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator.FromCommand*) method implementation will always return `null`, but this method can be overridden by derived classes to automatically provide key tips for known commands.
98+
}
99+
@if (wpf) {
90100
The default [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator.FromCommand*) method implementation will analyze an `ICommand` to determine the best key tip text.
91101

92102
If the `ICommand` is a `RoutedCommand`, the `RoutedCommand.InputGestures` collection will be queried for gestures of type `KeyGesture`. The first `KeyGesture` that returns a non-`null` value when passed to [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).[FromKeyGesture](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator.FromKeyGesture*) will be used as the key tip text.
93103

94104
A value of `null` will be returned if a value for key tip text could not be determined from the `ICommand`.
105+
}
95106

96107
## Localization
97108

@@ -105,7 +116,7 @@ The following steps can be used to implement localized label generation:
105116

106117
1. Create a new class that derives from [LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator).
107118
1. Override the [LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator).[FromKey](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator.FromKey*) method to return a localized label for the given key.
108-
1. Optionally override the [LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator.FromCommand*) method to return a localized label for the given command. This is only necessary if the `RoutedUICommand.Text` or `RoutedCommand.Name` properties are not already localized.
119+
1. Optionally override the [LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.LabelGenerator.FromCommand*) method to return a localized label for the given command.@if (wpf) { This is only necessary if the `RoutedUICommand.Text` or `RoutedCommand.Name` properties are not already localized. }
109120
1. During application startup before any UI is initialized, set the [BarControlService](xref:@ActiproUIRoot.Controls.Bars.BarControlService).[LabelGenerator](xref:@ActiproUIRoot.Controls.Bars.BarControlService.LabelGenerator) property to an instance of the custom class.
110121

111122
> [!NOTE]
@@ -119,7 +130,7 @@ The following steps can be used to implement localized key tip generation:
119130

120131
1. Create a new class that derives from [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).
121132
1. Override the [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).[FromLabel](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator.FromLabel*) method to return a localized key tip text for the given label.
122-
1. Optionally override the [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator.FromCommand*) method to return a localized key tip text for the given command. This is only necessary if key tip text cannot be auto-generated from a `KeyGesture` defined within `RoutedCommand.InputGestures`.
133+
1. Optionally override the [KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator).[FromCommand](xref:@ActiproUIRoot.Controls.Bars.KeyTipTextGenerator.FromCommand*) method to return a localized key tip text for the given command.@if (wpf) { This is only necessary if key tip text cannot be auto-generated from a `KeyGesture` defined within `RoutedCommand.InputGestures`. }
123134
1. During application startup before any UI is initialized, set the [BarControlService](xref:@ActiproUIRoot.Controls.Bars.BarControlService).[KeyTipTextGenerator](xref:@ActiproUIRoot.Controls.Bars.BarControlService.KeyTipTextGenerator) property to an instance of the custom class.
124135

125136
> [!NOTE]

0 commit comments

Comments
 (0)