|
-
September 30th, 2014, 02:41 PM
#1
XAML + WPF namespace
I have this code:
<Window x:Class="WpfSimple.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfSimple"
Title="MainWindow" Height="150" Width="370">
<Window.DataContext>
<local:MainWindowViewModel/>
</Window.DataContext>
<Grid>
<Button Name="btnClick"
Content="Click"
HorizontalAlignment="Left"
Height="23"
Margin="77,45,0,0"
VerticalAlignment="Top"
Width="203"
Command = "{Binding ButtonCommand}"
CommandParameter="Hai"/>
</Grid>
</Window>
and this namespace class:
namespace WpfSimple
{
//www.codeproject.com/Articles/126249/MVVM-Pattern-in-WPF-A-Simple-Tutorial-for-Absolute
class MainWindowViewModel
{ .......
But in the XAML section the tak: <Window.DataContext> told me: the name "MainWindowViewModel" dont exist the namespace "clr-namespace:WpfSimple"
What can it be?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|