Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Closed Issue: Exception when ListPickerMode set to Full [8207]

$
0
0
When testing the picker with a basic example, I get an InvalidOperationException : "To get SystemTray visibility the RootVisual must be a PhoneApplicationFrame and its Content must be a PhoneApplicationPage" when I set ListPickerMode = Full

XAML :
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

<Grid.Resources>
<DataTemplate x:Name="PickerItemTemplate">
<StackPanel Orientation="Horizontal">
<Border Background="LightGreen" Width="34" Height="34">
<TextBlock Text="{Binding Country}"
FontSize="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<TextBlock Text="{Binding Name}"
Margin="12 0 0 0"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Name="PickerFullModeItemTemplate">
<StackPanel Orientation="Horizontal"
Margin="16 21 0 20">
<TextBlock Text="{Binding Name}"
Margin="16 0 0 0"
FontSize="43"
FontFamily="{StaticResource PhoneFontFamilyLight}"/>
<ContentControl Foreground="Green"
VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="("/>
<TextBlock Text="{Binding Language}" />
<TextBlock Text=")"/>
</StackPanel>
</ContentControl>
</StackPanel>
</DataTemplate>
</Grid.Resources>

<StackPanel>
<toolkit:ListPicker x:Name="listPicker"
ItemTemplate="{StaticResource PickerItemTemplate}"
FullModeItemTemplate="{StaticResource PickerFullModeItemTemplate}"
Header="Cities"
CacheMode="BitmapCache"
FullModeHeader="CITIES"
ListPickerMode="Full" >
</toolkit:ListPicker>

</StackPanel>
</Grid>
</Grid>

CODE BEHIND :

public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();

List<Cities> source = new List<Cities>();
source.Add(new Cities() { Name = "Madrid", Country = "ES", Language = "Spanish" });
source.Add(new Cities() { Name = "Las Vegas", Country = "US", Language = "English" });
source.Add(new Cities() { Name = "London", Country = "UK", Language = "English" });
source.Add(new Cities() { Name = "Mexico", Country = "MX", Language = "Spanish" });

listPicker.ItemsSource = source;
}
}

public class Cities
{
public string Name { get; set; }
public string Country { get; set; }
public string Language { get; set; }
}
Comments:

Tried on the latest version of the toolkit and this no longer repros. ListPickerMode is no longer settable via user code.


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>