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

Modifying Properties to Pre-Made ViewModels Does Not Work #114

Open
askariya opened this issue Apr 4, 2024 · 0 comments
Open

Modifying Properties to Pre-Made ViewModels Does Not Work #114

askariya opened this issue Apr 4, 2024 · 0 comments

Comments

@askariya
Copy link

askariya commented Apr 4, 2024

I want to be able to use the existing DualResponseViewModel and attach my own XAML to it.
However, if I do this, it seems like I can't pass in my own arguments/properties via the method identified in the documentation.

  • If the property isn't already predefined in the DualResponseViewModel I'll get a Null Reference Error.

  • If the property exists, I won't get a null reference error but I might get a "No Setter available error" or I get no error but using the property won't work.
    For Example:
    var args = new Dictionary<string, object>() { { "LeftButtonText", "TestText" } }; bool result = await DualResponseViewModel.GenerateVM().GeneratePopup<ModifiedDualMopupPopup>(args);

With the above code, I also have the following xaml within the ModifiedDualMopupPopup.xaml:
<Button x:Name="CloseButton" Margin="10,5" HorizontalOptions="Fill" VerticalOptions="EndAndExpand" Text="{Binding LeftButtonText}" Command="{Binding LeftButtonCommand}"/>

However, the LeftButtonText will not actually get populated with the value I specified in the args when the popup opens, rather it will be blank.

Am I doing something wrong, or is this the expected behaviour? If so, what is the point of being able to customize the xaml for something like the DualResponseViewModel if we can't use the pre-defined properties/commands?

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

1 participant