My company uses some global styles for xam controls. I need to override some of those styles for a specific instance of a xamcomboeditor.
In the style below I set the background to yellow and the font size to 50. The background is set correctly but the fontsize is not. Why is that? I suspect I need to create a style for a type other than xamcomboeditor. I want to hard code the fontsize at the control level so no other style overrides it. How do I do that?
<igEditors:XamComboEditor
x:Name="transferTypeCombo"
Style="{StaticResource BaseXamComboEditor}"
ValuePath="Tag"
Width="120"
Value="{Binding NATIVE_TRANSFER_TYPE}">
<igEditors:XamComboEditor.ItemsProvider>
<igEditors:ComboBoxItemsProvider>
<igEditors:ComboBoxItemsProvider.Items>
<igEditors:ComboBoxDataItem DisplayText="PM Transfer" Value="0"></igEditors:ComboBoxDataItem>
<igEditors:ComboBoxDataItem DisplayText="Auction" Value="1"></igEditors:ComboBoxDataItem>
</igEditors:ComboBoxItemsProvider.Items>
</igEditors:ComboBoxItemsProvider>
</igEditors:XamComboEditor.ItemsProvider>
</igEditors:XamComboEditor>
Hello,
The reason why inner textBlock change its fontSize is because of the first Style. It doesn't have set a key, so it applies for all TextBlock in the application. If you remove this style(it's placed at your App.xaml) or set it a key, then xamEditor should work as expected.
Regards,
Anastas
Hello...is any one looking into this bug?
Attached is a test program to reproduce the issue where the XamEditors are not setting the fontsize correctly for the inner TextBlock
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="12" />
</Style>
<Style TargetType="igEditor:XamNumericEditor" x:Key="BaseXamNumericEditor">
<Setter Property="FontSize" Value="50"/>
<igEditor:XamNumericEditor Style="{StaticResource BaseXamNumericEditor}" Mask="{}{double:15.5}" Text="12345.67" />
<ControlTemplate x:Key="EditControlTemplate" TargetType="igEditor:XamNumericEditor"> <Border x:Name="OutsideBorder" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <TextBox x:Name="InnerTextBlock" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding DisplayText}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/> </Border> </ControlTemplate>
<igEditor:XamNumericEditor Style="{StaticResource BaseXamNumericEditor}" Mask="{}{double:15.5}" Text="12345.67" EditTemplate={StaticResource EditControlTemplate} />
Hi,
After looking at your response I realized you are using the xamComboEditor that is WPF only, not the shared control by the same name.
The styles are different and the information I gave you before was for the shared control.
I've been looking at the WPF control and see the behavior you described. I added a style to a dictionary that I then customized in the app but which is basedon the global style.
I then added some textblocks to my sample for purposes of comparison and realized that the customized style is being applied to those textblocks but not to the textblocks that are part of the xamComboEditor style. The xamComboEditor is using the customized textblock style defined in the app.xaml.
I want to look into this further before I submit it to development. You will hear from me shortly either way.
I appreciate your patience while I work thru this question.