Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# Code in Collections example seems to be the same as that in RelayCommand #112

Open
dmedine opened this issue Feb 15, 2023 · 1 comment

Comments

@dmedine
Copy link

dmedine commented Feb 15, 2023

ViewModel code appears to be unfinished:
https://github.com/CommunityToolkit/MVVM-Samples/blob/master/samples/MvvmSample.Core/ViewModels/CollectionsPageViewModel.cs#L1-L15

The text for the C# in the View is the same as the text for the C# in the RelayCommand view:

<controls:InteractiveSample.CSharpCode>
public class MyViewModel : ObservableObject
{
public MyViewModel()
{
IncrementCounterCommand = new RelayCommand(IncrementCounter);
}
private int counter;
public int Counter
{
get =&gt; counter;
private set =&gt; SetProperty(ref counter, value);
}
public ICommand IncrementCounterCommand { get; }
private void IncrementCounter() =&gt; Counter++;
}
</controls:InteractiveSample.CSharpCode>

https://github.com/CommunityToolkit/MVVM-Samples/blob/master/samples/MvvmSampleUwp/Views/RelayCommandPage.xaml#L47-L76

@michael-hawker
Copy link
Member

michael-hawker commented Apr 6, 2023

I just went to go look at this sample and found the same thing. FYI @Sergio0694

I believe this is the ViewModel being used here: https://github.com/CommunityToolkit/MVVM-Samples/blob/master/samples/MvvmSample.Core/ViewModels/Widgets/ContactsListWidgetViewModel.cs

Not sure where the CollectionsPageViewModel is used, that's something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants