M
mp
dumb newb question
reading article on control template
start new project, add wpf window,
don't know where to paste the control template snippet
<ControlTemplate x:Key="MyListBoxTemplate" TargetType="{x:Type ListBox}">
<Border Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="6">
<ScrollViewer Margin="4">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
the empty window code (when add wpf window to project) is:
<Window x:Class="WpfApplication1.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="300" Width="300">
<Grid>
</Grid>
</Window>
i cant' find anywhere inside that code block to paste the control code that
doesn't produce compiler errors.
thanks
mark
reading article on control template
start new project, add wpf window,
don't know where to paste the control template snippet
<ControlTemplate x:Key="MyListBoxTemplate" TargetType="{x:Type ListBox}">
<Border Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="6">
<ScrollViewer Margin="4">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
the empty window code (when add wpf window to project) is:
<Window x:Class="WpfApplication1.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="300" Width="300">
<Grid>
</Grid>
</Window>
i cant' find anywhere inside that code block to paste the control code that
doesn't produce compiler errors.
thanks
mark