listpicker

ListPicker shows object name instead of property

放肆的年华 提交于 2019-12-11 07:29:50
问题 In my model I have class: public class Heaviness { public int ID {get; set;} public string NameToDisplay {get; set;} } in my view model I have a property HeavinessList: public ObservableCollection<Heaviness> HeavinessList {get;set;} In my xaml I added ListPicker with items source binded to HeavinessList; its data template for item is binded to NameToDisplay property of Heaviness object. <StackPanel x:Name="HeavinessGroup" Width="220" HorizontalAlignment="Left"> <TextBlock x:Name=

Scrollable ListPicker items list

自作多情 提交于 2019-12-11 06:31:46
问题 I have a Popup control in my application. In this popup I use a ListPicker object to choose the proper item. If the list of items if quite small, everything works fine, but, however, if the list items number is big, the list of items is shown at a new page somewhere at the background. That's the native behavior for ExpansionMode.FullScreenOnly of ListPicker, but I can't use it that way. Is there a way to make a list of items scrollable to save the ListPicker behaviour of ExpansionAllowed

windows phone 8.1 ComboBox shows multiple items as selected when number of items are more

只愿长相守 提交于 2019-12-08 15:28:44
问题 When there are more items in combobox,combobox will show the listpicker flyout. If I select first one and scroll down,more than one item will be shown as selected. But SelectedItem of ComboBox will be the one which i selected. I modified the style of ListPickerFlyout and turned off the virtualization of ListView. If I do so ListView wont retain the SelectedItem. Is this bug of ComboBox? Is there any solution for this issue Here is style which i modified <DataTemplate x:Key=

How to Get the Selected Item of a ListPicker

笑着哭i 提交于 2019-12-07 17:12:15
问题 I would like to determine the name of the item that is currently selected in a ListPicker. I am not sure what to do in the SelectionChanged event to get the name of the item. XAML <Grid.Resources> <DataTemplate x:Name="PickerItemTemplate"> <TextBlock Text="{Binding Name}"/> </DataTemplate> </Grid.Resources> <toolkit:ListPicker x:Name="ThemeListPicker" Header="{Binding Path=LocalizedResources.SettingsPage_ThemeListPicker_Header, Source={StaticResource LocalizedStrings}}" ItemTemplate="

How to Get the Selected Item of a ListPicker

不羁岁月 提交于 2019-12-06 05:04:49
I would like to determine the name of the item that is currently selected in a ListPicker. I am not sure what to do in the SelectionChanged event to get the name of the item. XAML <Grid.Resources> <DataTemplate x:Name="PickerItemTemplate"> <TextBlock Text="{Binding Name}"/> </DataTemplate> </Grid.Resources> <toolkit:ListPicker x:Name="ThemeListPicker" Header="{Binding Path=LocalizedResources.SettingsPage_ThemeListPicker_Header, Source={StaticResource LocalizedStrings}}" ItemTemplate="{StaticResource PickerItemTemplate}" SelectionChanged="ThemeListPicker_SelectionChanged"/> XAML.CS protected

Binding ListPicker.SelectedIndex problem

为君一笑 提交于 2019-12-04 03:45:39
I'm trying to do a two way binding of the SelectedIndex attribute of a ListPicker in a Windows Phone 7 UserControl. It raises the following exception when I set the DataContext: SelectedIndex must always be set to a valid value. This is the XAML code <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <toolkit:ListPicker Grid.Row="0" x:Name="List1" SelectionChanged="Picker_SelectionChanged" SelectedIndex="{Binding PickerSelectedIndex, Mode=TwoWay}" ItemTemplate="{StaticResource PickerTemplate}" ItemsSource="