Hi everybody,
I may be a bad coder, but my XAML/WPF/MPF knowledge is even worse. I'm trying hard, but I need your help. I started with the screen in the HelloWorldExample. I modified it a bit, added some labels, progress bars and a picture, which worked perfectly. Then I wanted to add a listview (code below) - since I didn't find an easier example, I took the one from the GuiTestPlugin. There is no dynamic content, yet, I just wanted to add some static ListViewItems to get a feeling how it looks like, but I cannot get a single item to show up. The ListView is just empty and I had to add a "Background" to see that it is actually there. I'm using the Reflexion Skin, but using the default one doesn't help either...
I'd really be grateful if someone could give me a hint - I may make a very stupid mistake here, but since I really have no clue of XAML, I just don't know where to start...
Thanks,
Michael
<Include
xmlns="www.team-mediaportal.com/2008/mpf/directx"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Source="screens\master_menu.xaml"
>
<Include.Resources>
<!-- Header -->
<ResourceWrapper x:Key="Header_Text" Resource="[MPMBCDRipper.ScreenTitle]"/>
<!-- Contents -->
<ControlTemplate x:Key="Contents_Template">
<DockPanel Context="{Model Id=2F7131D3-D12B-43e2-B5CF-E966D1E5AA50}" LastChildFill="True">
<StackPanel DockPanel.Dock="Left" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top">
<Image Margin="10,30,10,10" Width="500" Stretch="Uniform" Source="folder.jpg" />
<Label Content="Track Progress" Color="{ThemeResource TextColor}" Margin="10,20,10,5" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ProgressBar Margin="10,5,10,10" Name="TrackPBar" Width="500" Height="30" Value="100" />
<Label Content="CD Progress" Color="{ThemeResource TextColor}" Margin="10,10,10,5" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ProgressBar Margin="10,5,10,10" Name="CDPBar" Width="500" Height="30" Value="30"/>
<Button Content="[MPMBCDRipper.StartRippingButtonText]" Style="{ThemeResource ButtonWideStyle}" Margin="10,20,10,10"
HorizontalAlignment="Left" VerticalAlignment="Center" Width="500" HorizontalContentAlignment="Center"
Command="{Command StartRipping}"/>
</StackPanel>
<DockPanel.Resources>
<DataTemplate x:Key="ItemDataTemplate">
<Label x:Name="ItemDataLabel" Content="{Binding}" FontSize="{ThemeResource SmallFontSize}" Color="Blue"/>
</DataTemplate>
<Style x:Key="ListViewStyle" BasedOn="{ThemeResource DefaultListViewStyle}">
<Setter Property="ItemTemplate" Value="{ThemeResource ItemDataTemplate}"/>
<Setter Property="ItemContainerStyle" Value="{ThemeResource DefaultMenuItemContainerStyle}"/>
<Setter Property="Background" Value="{ThemeResource ItemsControlShadowBackgroundColor}"/>
</Style>
</DockPanel.Resources>
<ListView Margin="30,30,10,10" DockPanel.Dock="Center" Style="{ThemeResource ListViewStyle}">
<ListViewItem>
Simple string inside a ListViewItem - Should be styled with the container style
</ListViewItem>
</ListView>
</DockPanel>
</ControlTemplate>
</Include.Resources>
</Include>
I may be a bad coder, but my XAML/WPF/MPF knowledge is even worse. I'm trying hard, but I need your help. I started with the screen in the HelloWorldExample. I modified it a bit, added some labels, progress bars and a picture, which worked perfectly. Then I wanted to add a listview (code below) - since I didn't find an easier example, I took the one from the GuiTestPlugin. There is no dynamic content, yet, I just wanted to add some static ListViewItems to get a feeling how it looks like, but I cannot get a single item to show up. The ListView is just empty and I had to add a "Background" to see that it is actually there. I'm using the Reflexion Skin, but using the default one doesn't help either...
I'd really be grateful if someone could give me a hint - I may make a very stupid mistake here, but since I really have no clue of XAML, I just don't know where to start...
Thanks,
Michael
<Include
xmlns="www.team-mediaportal.com/2008/mpf/directx"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Source="screens\master_menu.xaml"
>
<Include.Resources>
<!-- Header -->
<ResourceWrapper x:Key="Header_Text" Resource="[MPMBCDRipper.ScreenTitle]"/>
<!-- Contents -->
<ControlTemplate x:Key="Contents_Template">
<DockPanel Context="{Model Id=2F7131D3-D12B-43e2-B5CF-E966D1E5AA50}" LastChildFill="True">
<StackPanel DockPanel.Dock="Left" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top">
<Image Margin="10,30,10,10" Width="500" Stretch="Uniform" Source="folder.jpg" />
<Label Content="Track Progress" Color="{ThemeResource TextColor}" Margin="10,20,10,5" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ProgressBar Margin="10,5,10,10" Name="TrackPBar" Width="500" Height="30" Value="100" />
<Label Content="CD Progress" Color="{ThemeResource TextColor}" Margin="10,10,10,5" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ProgressBar Margin="10,5,10,10" Name="CDPBar" Width="500" Height="30" Value="30"/>
<Button Content="[MPMBCDRipper.StartRippingButtonText]" Style="{ThemeResource ButtonWideStyle}" Margin="10,20,10,10"
HorizontalAlignment="Left" VerticalAlignment="Center" Width="500" HorizontalContentAlignment="Center"
Command="{Command StartRipping}"/>
</StackPanel>
<DockPanel.Resources>
<DataTemplate x:Key="ItemDataTemplate">
<Label x:Name="ItemDataLabel" Content="{Binding}" FontSize="{ThemeResource SmallFontSize}" Color="Blue"/>
</DataTemplate>
<Style x:Key="ListViewStyle" BasedOn="{ThemeResource DefaultListViewStyle}">
<Setter Property="ItemTemplate" Value="{ThemeResource ItemDataTemplate}"/>
<Setter Property="ItemContainerStyle" Value="{ThemeResource DefaultMenuItemContainerStyle}"/>
<Setter Property="Background" Value="{ThemeResource ItemsControlShadowBackgroundColor}"/>
</Style>
</DockPanel.Resources>
<ListView Margin="30,30,10,10" DockPanel.Dock="Center" Style="{ThemeResource ListViewStyle}">
<ListViewItem>
Simple string inside a ListViewItem - Should be styled with the container style
</ListViewItem>
</ListView>
</DockPanel>
</ControlTemplate>
</Include.Resources>
</Include>