Themes - QuickNewMachineWindow : unable to override defaults
- strobotone
- Posts: 297
- Joined: Wed Nov 23, 2011 2:59 pm
- Location: berlin
- Contact:
Themes - QuickNewMachineWindow : unable to override defaults
Hi,
for some reason i am unable to override the default style of the QuickNewMachine Window.
i added a style (with a ControlTemplate) to MachineView.xaml :
<Style TargetType="{x:Type local:QuickNewMachineWindow}">
...
Although it is within the namespace of BuzzGUI.MachineView nothing happens.
Am i missing something?
Thanks !
for some reason i am unable to override the default style of the QuickNewMachine Window.
i added a style (with a ControlTemplate) to MachineView.xaml :
<Style TargetType="{x:Type local:QuickNewMachineWindow}">
...
Although it is within the namespace of BuzzGUI.MachineView nothing happens.
Am i missing something?
Thanks !
Re: Themes - QuickNewMachineWindow : unable to override defa
I'll have to update it to load the resource dictionary.
Re: Themes - QuickNewMachineWindow : unable to override defa
QuickNewMachineWindow, CreateTemplateWindow, LatencyWindow, CPUMonitorWindow and HDRecorderWindow should now support MachineView.xaml resources.
- strobotone
- Posts: 297
- Joined: Wed Nov 23, 2011 2:59 pm
- Location: berlin
- Contact:
Re: Themes - QuickNewMachineWindow : unable to override defa
oops. many thanks Oskari !
Works now.
Works now.
- strobotone
- Posts: 297
- Joined: Wed Nov 23, 2011 2:59 pm
- Location: berlin
- Contact:
Re: Themes - QuickNewMachineWindow : unable to override defa
i made this template for the window but the actual search and doubleclick function does not work.
how can i make the handler getting recognized?
<!--QuickNewMachineWindow Template-->
<Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
<!--<EventSetter Event="MouseDoubleClick" Handler="OnDoubleClickItem" />-->
</Style>
<DataTemplate x:Key="MachineListItemTemplate">
<TextBlock Text="{Binding Path=DisplayName}" Foreground="#cccccc"/>
</DataTemplate>
<Style TargetType="{x:Type local:QuickNewMachineWindow}">
<Setter Property="AllowsTransparency" Value="True"/>
<Setter Property="MinWidth" Value="200"/>
<Setter Property="MinHeight" Value="323"/>
<Setter Property="SizeToContent" Value="Width"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuickNewMachineWindow}">
<Border BorderBrush="#c0111111" BorderThickness="2" CornerRadius="3" >
<Border Background="#e0080808"
BorderBrush="#cccccc"
BorderThickness="2"
CornerRadius="3"
Padding="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0"
BorderBrush="#666"
BorderThickness="1"
CornerRadius="2"
Margin="3">
<TextBox Name="textBox"
BorderThickness="0"
Background="#e3282828"
Foreground="#eeeeee"/>
</Border>
<Border Grid.Row="1"
BorderBrush="#666"
BorderThickness="1"
CornerRadius="2"
Margin="3"
Padding="2">
<ListBox Name="listBox"
ItemsSource="{Binding Path=Items}"
ItemContainerStyle="{StaticResource ItemStyle}"
ItemTemplate="{StaticResource MachineListItemTemplate}"
VirtualizingStackPanel.IsVirtualizing="True"
BorderThickness="0"
Padding="0,0,8,0">
<ListBox.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#e8080808"/>
<GradientStop Offset="1" Color="#e8161616"/>
</LinearGradientBrush>
</ListBox.Background>
</ListBox>
</Border>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
how can i make the handler getting recognized?
<!--QuickNewMachineWindow Template-->
<Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
<!--<EventSetter Event="MouseDoubleClick" Handler="OnDoubleClickItem" />-->
</Style>
<DataTemplate x:Key="MachineListItemTemplate">
<TextBlock Text="{Binding Path=DisplayName}" Foreground="#cccccc"/>
</DataTemplate>
<Style TargetType="{x:Type local:QuickNewMachineWindow}">
<Setter Property="AllowsTransparency" Value="True"/>
<Setter Property="MinWidth" Value="200"/>
<Setter Property="MinHeight" Value="323"/>
<Setter Property="SizeToContent" Value="Width"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuickNewMachineWindow}">
<Border BorderBrush="#c0111111" BorderThickness="2" CornerRadius="3" >
<Border Background="#e0080808"
BorderBrush="#cccccc"
BorderThickness="2"
CornerRadius="3"
Padding="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0"
BorderBrush="#666"
BorderThickness="1"
CornerRadius="2"
Margin="3">
<TextBox Name="textBox"
BorderThickness="0"
Background="#e3282828"
Foreground="#eeeeee"/>
</Border>
<Border Grid.Row="1"
BorderBrush="#666"
BorderThickness="1"
CornerRadius="2"
Margin="3"
Padding="2">
<ListBox Name="listBox"
ItemsSource="{Binding Path=Items}"
ItemContainerStyle="{StaticResource ItemStyle}"
ItemTemplate="{StaticResource MachineListItemTemplate}"
VirtualizingStackPanel.IsVirtualizing="True"
BorderThickness="0"
Padding="0,0,8,0">
<ListBox.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#e8080808"/>
<GradientStop Offset="1" Color="#e8161616"/>
</LinearGradientBrush>
</ListBox.Background>
</ListBox>
</Border>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
- Attachments
-
- qnmw02.jpg (40.48 KiB) Viewed 6871 times
-
- qnmw01.jpg (46.49 KiB) Viewed 6871 times
Re: Themes - QuickNewMachineWindow : unable to override defa
It's not possible to change the whole ControlTemplate because of the way it's written. I'll change it for the next build but I'm probably not going to do it for all the windows. The alternative is to only change styles of the controls that are used.
Re: Themes - QuickNewMachineWindow : unable to override defa
It should work in 1442. The names and the way double-click is handled have changed a bit.
- strobotone
- Posts: 297
- Joined: Wed Nov 23, 2011 2:59 pm
- Location: berlin
- Contact:
Re: Themes - QuickNewMachineWindow : unable to override defa
i see. thanks for the info!
but it does not seem to work from the Style:
<Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
<EventSetter Event="MouseDoubleClick" Handler="OnDoubleClickItem" />
</Style>
even though it is the same used in QuickNewMachineWindow.
but it does not seem to work from the Style:
<Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
<EventSetter Event="MouseDoubleClick" Handler="OnDoubleClickItem" />
</Style>
even though it is the same used in QuickNewMachineWindow.
Last edited by strobotone on Thu Feb 02, 2012 8:40 pm, edited 1 time in total.
Re: Themes - QuickNewMachineWindow : unable to override defa
Oops, it's still broken, but this will work in 1443:
Code: Select all
<!--QuickNewMachineWindow Template-->
<DataTemplate x:Key="MachineListItemTemplate">
<TextBlock Text="{Binding Path=DisplayName}" Foreground="#cccccc"/>
</DataTemplate>
<Style TargetType="{x:Type local:QuickNewMachineWindow}">
<Style.Resources>
<Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="bgc:CommandBehavior.Event" Value="MouseDoubleClick" />
<Setter Property="bgc:CommandBehavior.Command" Value="{Binding ElementName=PART_Window, Path=SelectCommand}" />
<Setter Property="bgc:CommandBehavior.CommandParameter" Value="{Binding}" />
</Style>
</Style.Resources>
<Setter Property="AllowsTransparency" Value="True"/>
<Setter Property="MinWidth" Value="200"/>
<Setter Property="MinHeight" Value="323"/>
<Setter Property="SizeToContent" Value="Width"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuickNewMachineWindow}">
<Border BorderBrush="#c0111111" BorderThickness="2" CornerRadius="3" >
<Border Background="#e0080808" BorderBrush="#cccccc" BorderThickness="2" CornerRadius="3" Padding="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#666" BorderThickness="1" CornerRadius="2" Margin="3">
<TextBox Name="PART_TextBox" BorderThickness="0" Background="#e3282828" Foreground="#eeeeee"/>
</Border>
<Border Grid.Row="1" BorderBrush="#666" BorderThickness="1" CornerRadius="2" Margin="3" Padding="2">
<ListBox Name="PART_ListBox" ItemsSource="{Binding Path=Items}" ItemContainerStyle="{StaticResource ItemStyle}" ItemTemplate="{StaticResource MachineListItemTemplate}"
VirtualizingStackPanel.IsVirtualizing="True" BorderThickness="0" Padding="0,0,8,0">
<ListBox.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#e8080808"/>
<GradientStop Offset="1" Color="#e8161616"/>
</LinearGradientBrush>
</ListBox.Background>
</ListBox>
</Border>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
- strobotone
- Posts: 297
- Joined: Wed Nov 23, 2011 2:59 pm
- Location: berlin
- Contact:
Re: Themes - QuickNewMachineWindow : unable to override defa
damn. you´re quick.
awesome, that solved it!
awesome, that solved it!