Click here to Skip to main content
15,793,735 members
Home / Discussions / WPF
   

WPF

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 4:09
cofounderChris Maunder16-Jul-09 4:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 4:05
cofounderChris Maunder16-Jul-09 4:05 
AnswerDataGrid Event Not Firing Pin
Kevin Marois30-Nov-23 14:11
professionalKevin Marois30-Nov-23 14:11 
GeneralRe: DataGrid Event Not Firing Pin
Andre Oosthuizen1-Dec-23 23:42
mveAndre Oosthuizen1-Dec-23 23:42 
GeneralRe: DataGrid Event Not Firing Pin
Kevin Marois2-Dec-23 8:41
professionalKevin Marois2-Dec-23 8:41 
QuestionDataGrid Exception Pin
Kevin Marois28-Nov-23 12:36
professionalKevin Marois28-Nov-23 12:36 
AnswerRe: DataGrid Exception Pin
Richard Deeming28-Nov-23 23:30
mveRichard Deeming28-Nov-23 23:30 
GeneralRe: DataGrid Exception Pin
Kevin Marois29-Nov-23 8:12
professionalKevin Marois29-Nov-23 8:12 
GeneralRe: DataGrid Exception Pin
Kevin Marois29-Nov-23 9:13
professionalKevin Marois29-Nov-23 9:13 
GeneralRe: DataGrid Exception Pin
Richard Deeming29-Nov-23 23:22
mveRichard Deeming29-Nov-23 23:22 
GeneralRe: DataGrid Exception Pin
Kevin Marois30-Nov-23 7:46
professionalKevin Marois30-Nov-23 7:46 
QuestionCustom Control Style Question Revisited Pin
Kevin Marois30-Oct-23 10:14
professionalKevin Marois30-Oct-23 10:14 
AnswerRe: Custom Control Style Question Revisited Pin
Gerry Schmitz30-Oct-23 13:20
mveGerry Schmitz30-Oct-23 13:20 
GeneralRe: Custom Control Style Question Revisited Pin
Kevin Marois31-Oct-23 9:01
professionalKevin Marois31-Oct-23 9:01 
QuestionUI Validation Problem Pin
Kevin Marois10-Oct-23 14:10
professionalKevin Marois10-Oct-23 14:10 
AnswerRe: UI Validation Problem Pin
Richard Deeming10-Oct-23 23:13
mveRichard Deeming10-Oct-23 23:13 
GeneralRe: UI Validation Problem Pin
Kevin Marois12-Oct-23 8:25
professionalKevin Marois12-Oct-23 8:25 
GeneralRe: UI Validation Problem Pin
Richard Deeming12-Oct-23 22:34
mveRichard Deeming12-Oct-23 22:34 
AnswerRe: UI Validation Problem Pin
Gerry Schmitz12-Oct-23 9:52
mveGerry Schmitz12-Oct-23 9:52 
GeneralRe: UI Validation Problem Pin
Kevin Marois12-Oct-23 15:54
professionalKevin Marois12-Oct-23 15:54 
GeneralRe: UI Validation Problem Pin
Gerry Schmitz12-Oct-23 20:12
mveGerry Schmitz12-Oct-23 20:12 
GeneralRe: UI Validation Problem Pin
Kevin Marois16-Oct-23 13:50
professionalKevin Marois16-Oct-23 13:50 
QuestionUI Validation Questions Pin
Kevin Marois29-Sep-23 16:54
professionalKevin Marois29-Sep-23 16:54 
AnswerRe: UI Validation Questions Pin
Richard Deeming1-Oct-23 22:43
mveRichard Deeming1-Oct-23 22:43 
QuestionCustom Control Style Question Pin
Kevin Marois14-Sep-23 13:35
professionalKevin Marois14-Sep-23 13:35 
I am creating a File Picker control, which will have a caption, a textbox, and a button with an image on it. Pretty straightforward. The control will live inside a controls project I have.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Marois.Framework.WPF.Controls">

<pre>
<SolidColorBrush x:Key="disabledBackgroundBrush" Color="Gray"/>

<Style TargetType="{x:Type local:MaroisFilePicker}">

    <Setter Property="Template">

        <Setter.Value>

            <ControlTemplate>

                <Border x:Name="border"
                        Background="{TemplateBinding Background}" 
                        BorderBrush="{TemplateBinding BorderBrush}" 
                        BorderThickness="{TemplateBinding BorderThickness}" 
                        CornerRadius="{TemplateBinding BorderThickness}">

                    <Grid>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Text="{Binding Caption}"
                                   x:Name="caption"
                                   Margin="2"/>

                        <TextBox Grid.Column="1"
                                 x:Name="textbox"
                                 Text="{Binding File}"/>

                        <Button Grid.Column="2"
                                x:Name="button"
                                Command="{Binding SelectedFileCommand}"/>

                    </Grid>

                </Border>

                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter TargetName="button" Property="Background" Value="{StaticResource disabledBackgroundBrush}" />
                    </Trigger>

                </ControlTemplate.Triggers>
            </ControlTemplate>

        </Setter.Value>

    </Setter>

</Style>



If you notice, I have defined a background brush for the textbox disabled state.

So here's the question. All of this lives in my Marois.Framework.WPF.Controls library. When I use this in another app, how do I then define different colors for the controls? Do I need all of this xaml in my app? Or do I somehow reference each part of my control in a style?
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.