Click here to Skip to main content
15,889,116 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: EnumDescriptionConverter Exception Pin
Kevin Marois20-Jan-17 11:38
professionalKevin Marois20-Jan-17 11:38 
Questionc# WPF MVVM accesing a view with from another view Pin
Member 1288059514-Jan-17 21:56
Member 1288059514-Jan-17 21:56 
AnswerRe: c# WPF MVVM accesing a view with from another view Pin
Pete O'Hanlon15-Jan-17 21:46
mvePete O'Hanlon15-Jan-17 21:46 
GeneralRe: c# WPF MVVM accesing a view with from another view Pin
Member 1288059516-Jan-17 8:05
Member 1288059516-Jan-17 8:05 
AnswerRe: c# WPF MVVM accesing a view with from another view Pin
Richard Deeming16-Jan-17 2:26
mveRichard Deeming16-Jan-17 2:26 
GeneralRe: c# WPF MVVM accesing a view with from another view Pin
Member 1288059516-Jan-17 8:31
Member 1288059516-Jan-17 8:31 
GeneralRe: c# WPF MVVM accesing a view with from another view Pin
Richard Deeming16-Jan-17 9:12
mveRichard Deeming16-Jan-17 9:12 
GeneralRe: c# WPF MVVM accesing a view with from another view Pin
Member 1288059517-Jan-17 8:05
Member 1288059517-Jan-17 8:05 
I have tried, to call the method, by having a MainWindowViewModel property, and call ViewChangeMethod() in the setter, but it doesnt work;

C#
public HomeViewModel(MainWindowViewModel mwvm)
{
    TaskList = new ObservableCollection<Models.Task>(tDC.Tasks);
    MwVm = mwvm;
}

public MainWindowViewModel MwVm
{
    get { return _mwVm; }
    set {if(value != null)
            _mwVm = value;
            RaisePropertyChanged();
            ViewChange();
    }
}


XML
<ListView x:Name="LstVviewTaskList" Height="181" Width="120" Margin="10,35,270,0" VerticalAlignment="Top" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" ItemsSource="{Binding TaskList}" SelectedItem="{Binding SelectedTask,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
           <ListView.ContextMenu>
               <ContextMenu>
                   <MenuItem Header="Add Task" Background="AliceBlue" Command="{Binding MwVm, UpdateSourceTrigger=PropertyChanged}"/>
                   <MenuItem Header="Edit Task" Background="AliceBlue" Command="{Binding MwVm, UpdateSourceTrigger=PropertyChanged}"/>
                   <MenuItem Header="Remove Task" Background="AliceBlue" Command="{Binding MwVm, UpdateSourceTrigger=PropertyChanged}"/>
               </ContextMenu>
           </ListView.ContextMenu>


What should i make sure i checked/have to check, in this case?
If i bind a contextmenu item(located in my HomeView) to a MainWindow Button, and the command associated with it, should i specify the datacontext in xaml?
GeneralRe: c# WPF MVVM accesing a view with from another view Pin
Richard Deeming17-Jan-17 8:40
mveRichard Deeming17-Jan-17 8:40 
GeneralRe: c# WPF MVVM accesing a view with from another view Pin
Member 1288059517-Jan-17 8:52
Member 1288059517-Jan-17 8:52 
QuestionBind To Static Property Pin
Kevin Marois13-Jan-17 5:32
professionalKevin Marois13-Jan-17 5:32 
AnswerRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 5:55
mveRichard Deeming13-Jan-17 5:55 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 6:01
professionalKevin Marois13-Jan-17 6:01 
GeneralRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 7:49
mveRichard Deeming13-Jan-17 7:49 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 7:56
professionalKevin Marois13-Jan-17 7:56 
GeneralRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 8:18
mveRichard Deeming13-Jan-17 8:18 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 8:23
professionalKevin Marois13-Jan-17 8:23 
GeneralRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 8:24
mveRichard Deeming13-Jan-17 8:24 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 8:25
professionalKevin Marois13-Jan-17 8:25 
GeneralRe: Bind To Static Property Pin
Richard Deeming13-Jan-17 8:29
mveRichard Deeming13-Jan-17 8:29 
GeneralRe: Bind To Static Property Pin
Kevin Marois13-Jan-17 8:31
professionalKevin Marois13-Jan-17 8:31 
QuestionWPF/MVVM - How To Make A Chess Board Pin
Kevin Marois20-Dec-16 6:13
professionalKevin Marois20-Dec-16 6:13 
AnswerRe: WPF/MVVM - How To Make A Chess Board Pin
Meshack Musundi26-Dec-16 19:26
professionalMeshack Musundi26-Dec-16 19:26 
QuestionMetroTabItem View Going out of Scope Pin
JPKI13-Dec-16 12:59
JPKI13-Dec-16 12:59 
AnswerRe: MetroTabItem View Going out of Scope Pin
Pete O'Hanlon13-Dec-16 20:50
mvePete O'Hanlon13-Dec-16 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.