文章分類/Infragistics
若要在編輯XamEditor(XamCurrencyEditor、XamDateTimeEditor、XamMaskedEditor、XamNumericEditor、XamMaskedEditor)時設定文字色彩與背景色彩,
<!-- XamCurrencyEditor の場合 --> <igEditors:XamCurrencyEditor> <igEditors:XamCurrencyEditor.Resources> <Style TargetType="{x:Type igEditors:XamCurrencyEditor}"> <Style.Triggers> <Trigger Property="IsInEditMode" Value="True"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="White"/> </Trigger> </Style.Triggers> </Style> </igEditors:XamCurrencyEditor.Resources> </igEditors:XamCurrencyEditor> <!-- XamDateTimeEditor の場合 --> <igEditors:XamDateTimeEditor> <igEditors:XamDateTimeEditor.Resources> <Style TargetType="{x:Type igEditors:XamDateTimeEditor}"> <Style.Triggers> <Trigger Property="IsInEditMode" Value="True"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="White"/> </Trigger> </Style.Triggers> </Style> </igEditors:XamDateTimeEditor.Resources> </igEditors:XamDateTimeEditor> <!-- XamMaskedEditor の場合 --> <igEditors:XamMaskedEditor> <igEditors:XamMaskedEditor.Resources> <Style TargetType="{x:Type igEditors:XamMaskedEditor}"> <Style.Triggers> <Trigger Property="IsInEditMode" Value="True"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="White"/> </Trigger> </Style.Triggers> </Style> </igEditors:XamMaskedEditor.Resources> </igEditors:XamMaskedEditor> <!-- XamNumericEditor の場合 --> <igEditors:XamNumericEditor> <igEditors:XamNumericEditor.Resources> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Style.Triggers> <Trigger Property="IsInEditMode" Value="True"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="White"/> </Trigger> </Style.Triggers> </Style> </igEditors:XamNumericEditor.Resources> </igEditors:XamNumericEditor> <!-- XamTextEditor の場合 --> <igEditors:XamTextEditor> <igEditors:XamTextEditor.Resources> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Style.Triggers> <Trigger Property="IsInEditMode" Value="True"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="White"/> </Trigger> </Style.Triggers> </Style> </igEditors:XamTextEditor.Resources> </igEditors:XamTextEditor> <!-- テーマを当てている場合は、Style の BasedOn で当てているテーマをベースとすることを忘れないでください。 --> <igEditors:XamMaskedEditor Theme="MetroDark"> <igEditors:XamMaskedEditor.Resources> <Style TargetType="{x:Type igEditors:XamMaskedEditor}" BasedOn="{x:Static igThemes:EditorsMetroDark.XamMaskedEditor}"> <Style.Triggers> <Trigger Property="IsInEditMode" Value="True"> <Setter Property="Foreground" Value="Black"/> <Setter Property="Background" Value="LightBlue"/> </Trigger> </Style.Triggers> </Style> </igEditors:XamMaskedEditor.Resources> </igEditors:XamMaskedEditor>