Comments (5)
Imported comment written by Yury Yatskov on 2016-05-13T22:04:45
How do I get an incoming argument when EventName = "Loaded"?
from damirscorner-utterances.
Imported comment written by Damir Arh on 2016-05-14T09:04:19
The event argument will automatically be sent to your command if its signature allows incoming arguments. E.g.:
public ICommand ActivateCommand { get; } =
new RelayCommand<routedeventargs>(arg =>
{
// args value will be the same as
// the second argument value in the event handler
}
from damirscorner-utterances.
Imported comment written by Yury Yatskov on 2016-05-16T15:23:06
Thank you!
Input has argument = null.
Required to pass the selected value (class) from one page to another. The value is selected in the ListView on Page1 and is passed as the input parameter Page2.
On Page1 navigation:
AppShell.Current.AppFrame.Navigate (typeof (CashAccountPageElement), SelectedCashAccount);
On Page2:
XAML:
...
xmlns: interactivity = "using: Microsoft.Xaml.Interactivity"
xmlns: core = "using: Microsoft.Xaml.Interactions.Core"
....
<interactivity: interaction.behaviors="">
<core: eventtriggerbehavior="" eventname="Loaded">
<core: invokecommandaction="" command="{Binding Path = LoadedCommand, Mode = OneWay}"/>
</interactivity:interaction.behaviors>
....
CS (ViewModel):
private RelayCommand <routedeventargs> loadedCmd;
public RelayCommand <routedeventargs> LoadedCommand
{
get
{
return this.loadedCmd ?? (This.loadedCmd = new RelayCommand <routedeventargs>
((Rea) =>
{
var result = rea;
}));
}
}
It accepts the argument "rea" of null. (SelectedCashAccount not null)
What do I need to add?
from damirscorner-utterances.
Imported comment written by Damir Arh on 2016-05-17T21:58:20
Well, the parameter that you are passing to Page2 via Navigate method is not included in RoutedEventArgs of Loaded event.
You will need to read the value by overriding OnNavigatedTo in Page2:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var parameter = e.Parameter;
}
You can pass this value to the view model directly from within this method by setting a property or invoking one of its methods.
from damirscorner-utterances.
Imported comment written by Yury Yatskov on 2016-05-17T22:03:07
Override OnNavigatedTo - works!
Thank you!
from damirscorner-utterances.
Related Issues (20)
- /blog/posts/20220408-DebounceSearchCallsInAngular.html HOT 2
- /blog/posts/20221007-CustomizingAdvancedSlidesForObsidian.html HOT 3
- /blog/posts/20230106-UsingMdcInQuarkus.html HOT 2
- blog/posts/20211203-StronglyTypedNgTemplateInAngular HOT 1
- blog/posts/20220930-ResettingPublishingProfilePassword
- blog/posts/20230414-RunGitHubActionsOnASynologyNas
- blog/posts/20230407-DatabaseConnectionsOverSsh HOT 1
- blog/posts/20220729-CrossComponentAngularForms HOT 3
- blog/posts/20230602-UpdatingTheSelfHostedGitHubRunner HOT 2
- blog/posts/20220923-TroubleshootingXamlErrorInWpf HOT 1
- blog/posts/20210910-AsynchronousPipesInAngular HOT 1
- blog/posts/20210917-TestingTimersWithFakeAsync HOT 1
- blog/posts/20211126-UsingNvmOnWindows HOT 3
- blog/posts/20221209-ShowingKeyboardShortcutsInIde HOT 1
- blog/posts/20180831-CodeGenerationWithMavenCxfPlugin HOT 1
- blog/posts/20220520-ComparingJsonStringsInUnitTests HOT 2
- blog/posts/20220211-CustomEventTypesInIonic HOT 2
- blog/posts/20230310-TypeScriptInteropInBlazor HOT 1
- blog/posts/20221223-MockitoAndNonNullTypesInKotlin HOT 1
- blog/posts/20210312-ReturnValueFromXamarinFormsShellModal HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from damirscorner-utterances.