Click here to Skip to main content
15,900,461 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
Pete O'Hanlon15-May-16 19:33
mvePete O'Hanlon15-May-16 19:33 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
indian14316-May-16 6:32
indian14316-May-16 6:32 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
Pete O'Hanlon16-May-16 7:05
mvePete O'Hanlon16-May-16 7:05 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
indian14316-May-16 14:39
indian14316-May-16 14:39 
Hi,

I changed it as below, but still it is giving me the same error, any help please, still it is saying me that and in the UI it is saying invalid xaml.
Error   1   The name "TestViewModel" does not exist in the namespace "clr-namespace:TestWPFApplication.ViewModel".  \\VBOXSVR\VMShared\Test Projects\TestWPFApplication\TestWPFApplication\View\MainWindow.xaml 9   9   TestWPFApplication

My code is below, any help please?
<Window x:Class="TestWPFApplication.MainWindow"<br />
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:testns="clr-namespace:TestWPFApplication.ViewModel"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" >
       <Window.DataContext>
        <testns:TestViewModel Name="Abdul">
        </testns:TestViewModel>
    </Window.DataContext>
    <Grid>
        <Label Content="Enter Name" HorizontalAlignment="Left" Margin="58,62,0,0" VerticalAlignment="Top" Name="lblName"/>
        <TextBox Text="{Binding Name, Mode=OneWay}"  HorizontalAlignment="Left" Height="22" Margin="160,64,0,0" TextWrapping="Wrap" 
                 Name="txtName" VerticalAlignment="Top" Width="120"/>

<pre>
    <Button Content="Save" HorizontalAlignment="Left" Margin="277,142,0,0" VerticalAlignment="Top" Width="74" Name="btnSaveSpecific"
            Command="{Binding Path=TestSpecificCommand}"
            CommandParameter="{Binding ElementName=txtName, Path=Text}" />
            <DataGrid HorizontalAlignment="Left" Margin="103,188,0,0" VerticalAlignment="Top" Height="98" Width="313" 
        IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=PersonNames, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
              AutoGenerateColumns="False"  >
        <DataGrid.Columns>
            <DataGridTextColumn Header="Name of Employee" Binding="{Binding Path=Name}" />
        </DataGrid.Columns> 
    </DataGrid>
</Grid>



Now I changed a little bit the ViewModel I put in a folder called ViewModel and Model in Model folder and changed their namespaces and changed the reference of clr-namespace as well but still the error persists.
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."


modified 16-May-16 20:53pm.

GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
Pete O'Hanlon16-May-16 20:47
mvePete O'Hanlon16-May-16 20:47 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
indian14316-May-16 22:08
indian14316-May-16 22:08 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
Pete O'Hanlon16-May-16 22:11
mvePete O'Hanlon16-May-16 22:11 
GeneralRe: Passing two parameters in Command biding in WPF and MVVM Pin
Meshack Musundi23-May-16 3:12
professionalMeshack Musundi23-May-16 3:12 
QuestionAdd Dictionary in ObsavableCollection Pin
indian14314-May-16 9:20
indian14314-May-16 9:20 
AnswerRe: Add Dictionary in ObsavableCollection Pin
Pete O'Hanlon14-May-16 22:07
mvePete O'Hanlon14-May-16 22:07 
AnswerRe: Add Dictionary in ObsavableCollection Pin
Richard Deeming16-May-16 1:18
mveRichard Deeming16-May-16 1:18 
GeneralRe: Add Dictionary in ObsavableCollection Pin
indian14316-May-16 6:35
indian14316-May-16 6:35 
QuestionDatagrid is not updating the values after changing the collection in the ViewModel in WPF Pin
indian14313-May-16 11:02
indian14313-May-16 11:02 
AnswerRe: Datagrid is not updating the values after changing the collection in the ViewModel in WPF Pin
Richard Deeming13-May-16 11:16
mveRichard Deeming13-May-16 11:16 
GeneralRe: Datagrid is not updating the values after changing the collection in the ViewModel in WPF Pin
indian14313-May-16 11:44
indian14313-May-16 11:44 
GeneralRe: Datagrid is not updating the values after changing the collection in the ViewModel in WPF Pin
indian14313-May-16 21:09
indian14313-May-16 21:09 
GeneralRe: Datagrid is not updating the values after changing the collection in the ViewModel in WPF Pin
Pete O'Hanlon14-May-16 3:39
mvePete O'Hanlon14-May-16 3:39 
QuestionConvert This XAML To C# Pin
Kevin Marois12-May-16 13:45
professionalKevin Marois12-May-16 13:45 
QuestionAdd a check box and delete multiple rows from DataGrid in WPF Pin
indian14312-May-16 8:46
indian14312-May-16 8:46 
AnswerRe: Add a check box and delete multiple rows from DataGrid in WPF Pin
Mycroft Holmes12-May-16 13:06
professionalMycroft Holmes12-May-16 13:06 
GeneralRe: Add a check box and delete multiple rows from DataGrid in WPF Pin
indian14312-May-16 14:12
indian14312-May-16 14:12 
QuestionUse Different Paths In Control Template Pin
Kevin Marois11-May-16 13:14
professionalKevin Marois11-May-16 13:14 
AnswerRe: Use Different Paths In Control Template Pin
Gerry Schmitz11-May-16 16:06
mveGerry Schmitz11-May-16 16:06 
QuestionHandle Title Bar Icon Click Pin
Kevin Marois11-May-16 5:56
professionalKevin Marois11-May-16 5:56 
AnswerRe: Handle Title Bar Icon Click Pin
CHill6011-May-16 22:42
mveCHill6011-May-16 22:42 

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.