Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Edit: I think you've already rejected this solution, but I am guessing that you only set the property for type Window, which won't have much of an effect. Window controls don't display text except...
Answer
#5: Post edited
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
<Style TargetType="{x:Type Window}"><Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" /></Style>- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- These styles are implicit, meaning they will apply to all controls of the specified type, because there's no x:Key specified.
- If you set an _explicit_ style for a control (meaning one with an x:Key), just make sure that you add the same font-family setter to the explicit style, or create a base style which contains it and base the explicit styles on the base style.
- **Edit**: I think you've already rejected this solution, but I am guessing that you only set the property for type Window, which won't have much of an effect. Window controls don't display text except in the titlebar, and you can't affect the titlebar display without completely restyling the window.
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- These styles are implicit, meaning they will apply to all controls of the specified type, because there's no x:Key specified.
- If you set an _explicit_ style for a control (meaning one with an x:Key), just make sure that you add the same font-family setter to the explicit style, or create a base style which contains it and base the explicit styles on the base style.
#4: Post edited
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type Window}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- These styles are implicit, meaning they will apply to all controls of the specified type, because there's no x:Key specified.
If set an explicit style for control, just make sure that you add the same setter to it, or create a base style which contains it and base the new styles on the base style.
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type Window}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- These styles are implicit, meaning they will apply to all controls of the specified type, because there's no x:Key specified.
- If you set an _explicit_ style for a control (meaning one with an x:Key), just make sure that you add the same font-family setter to the explicit style, or create a base style which contains it and base the explicit styles on the base style.
#3: Post edited
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type Window}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- If set an explicit style for control, just make sure that you add the same setter to it, or create a base style which contains it and base the new styles on the base style.
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type Window}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- These styles are implicit, meaning they will apply to all controls of the specified type, because there's no x:Key specified.
- If set an explicit style for control, just make sure that you add the same setter to it, or create a base style which contains it and base the new styles on the base style.
#2: Post edited
The best suggestion I have is to add implicit styles to the resource dictionary for items you want this font set on. For example:- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type Window}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- If set an explicit style for control, just make sure that you add the same setter to it, or create a base style which contains it and base the new styles on the base style.
- The best suggestion I have is to add implicit styles to the resource dictionary for the _**control types**_ you want this font set on. For example:
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- <Style TargetType="{x:Type Window}">
- <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" />
- </Style>
- (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...)
- If set an explicit style for control, just make sure that you add the same setter to it, or create a base style which contains it and base the new styles on the base style.
#1: Initial revision
The best suggestion I have is to add implicit styles to the resource dictionary for items you want this font set on. For example: <Style TargetType="{x:Type TextBlock}"> <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" /> </Style> <Style TargetType="{x:Type TextBox}"> <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" /> </Style> <Style TargetType="{x:Type Window}"> <Setter Property="TextElement.FontFamily" Value="{StaticResource Tajawal}" /> </Style> (etc., set all the common controls here like ComboBox, CheckBox, RadioButton...) If set an explicit style for control, just make sure that you add the same setter to it, or create a base style which contains it and base the new styles on the base style.