Menu Binding

Jun 25, 2013 at 7:43 AM
 <Fluent:BackstageTabItem Header="新建"
                                                 Fluent:KeyTip.Keys="N">
                            <Fluent:BackstageTabItem.ContentTemplate>
                                <DataTemplate>
                                    <StackPanel Background="#1C1C1C" >
                                        <TextBox local:Header.Header="名称" Text="{Binding Title}" />
                                        <TextBox local:Header.Header="位置" Text="{Binding DefaultDirectory}" />
                                        <Button Background="{StaticResource Brush-Accent}" Content="新建项目" Command="{Binding NewCommand}" />
                                    </StackPanel>
                                </DataTemplate>
                            </Fluent:BackstageTabItem.ContentTemplate>
                        </Fluent:BackstageTabItem>
var editorView = new EditorViewModel(editor);
this.DataContext = editorView;

NewCommand = new DelegateCommand(CreateProject);

now click button not trigger command
Developer
Jun 28, 2014 at 9:18 AM
Could you post a complete repro?
Developer
Jul 10, 2014 at 7:06 AM
You should notice that Current DataContext is changed by your code
this.DataContext = editorView;

So when button 's command is looking for a command with path " NewCommand", It will looks a property Named" NewCommand " on your viemodel->EditorViewModel

Those above is what i guessed for your problem.
Marked as answer by batzen on 9/20/2014 at 4:16 AM