Hi
i am new to wpf mvvm prism.
Here the items are static items(Not Resumed and Resumption and Cancellation).
current item of combobox is coming from database(i.e one of the static items)
The code is
ActionItems = null;
ActionItems = new O bservableCollection<ViewRequestStatusType>();
ActionType = new ViewRequestStatusType();
ActionType.Id = 1;
ActionType.Type = "Cancellation";
ActionItems.Add(ActionType);
ActionType = new ViewRequestStatusType();
ActionType.Id = 2;
ActionType.Type = "Not Resumed";
ActionItems.Add(ActionType);
ActionType = new ViewRequestStatusType();
ActionType.Id = 3;
ActionType.Type = "Resumption";
ActionItems.Add(ActionType);
ActionType = new ViewRequestStatusType();
ActionType.Id = 0;
ActionType.Type = obj.Data.Action;
ActionItems.Add(ActionType);
var cnt = ActionItems.Count;
ActionItems.Move(cnt - 1, 0);
Xaml code is
<combobox style="{StaticResource ValidateComboBox}" isenabled="{Binding Isshow }" fontsize="25" itemssource="{Binding ActionItems}">
SelectedItem="{Binding ActionType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True}"
DisplayMemberPath="Type" Margin="10,0,0,0" SelectedValuePath="Id" IsSynchronizedWithCurrentItem="True"
Height="40" Width="600" />
The output is
Not Resumed
Cancellation
Not Resumed
Resumption
Can anyone please help me
Thanks in advance