i can't figure out, why my App crashes or closes (it just quits, no break in debug-mode)
i try to navigate to another view, there are two possibilities, one works, the second causes the Crash:
private void Nachricht_EventClickTelMac_Mac(object sender, RoutedEventArgs e)
{
//MenuFlyoutItem mfi = sender as MenuFlyoutItem;
//GeräteAuslesenNavigationParameter p = new GeräteAuslesenNavigationParameter();
//p.MacAdressen = new List<string>();
//p.AuftragId = _viewmodel.Auftrag.auftrag_id;
//p.KundenNummer="";
//p.MacAdressen.Add((string)mfi.CommandParameter);
//mfi = null;
//sender = null;
Frame.Navigate(typeof(GeräteAuslesen), null);
}
private void KundenwerteAuslesen(object sender, RoutedEventArgs e)
{
//GeräteAuslesenNavigationParameter p = new GeräteAuslesenNavigationParameter();
//p.KundenNummer = _viewmodel.Auftrag.kunden_nr.ToString();
//p.AuftragId = _viewmodel.Auftrag.auftrag_id;
//p.MacAdressen = new List<string>();
Frame.Navigate(typeof(GeräteAuslesen), null);
}
I've commented out all differences, so the only difference is the Sender
KundenwerteAuslesen works well, Nachricht_EventClickTelMac_Mac leads to the Crash ... you can see the elements of the desired view flying in for about half a second, then the app Closes
does anybody have a clue whats going on?
Are the lines of code commented out when you observe the crash? and what event is calling those methods? (i.e. a button click?) – erotavlas 3 mins ago
yea it is commented out, because i wanted to know if the Problem is in These lines, but it isn't
this is the method calling Nachricht_EventClickTelMac_Mac:
private void Nachricht_EventClickTelMac(Hyperlink arg1, string arg2)
{
MenuFlyout fl = new MenuFlyout();
MenuFlyoutItem mfi1 = new MenuFlyoutItem();
mfi1.Text = "Telefonnummer Anrufen";
mfi1.Click += Nachricht_EventClickTelMac_Tel;
mfi1.CommandParameter = arg2;
MenuFlyoutItem mfi2 = new MenuFlyoutItem();
mfi2.Text = "Mac-Adresse auslesen";
mfi2.Click += Nachricht_EventClickTelMac_Mac;
mfi2.CommandParameter = arg2;
fl.Items.Add(mfi1);
fl.Items.Add(mfi2);
fl.ShowAt(Frame);
}
and this is the XAML calling KundenwerteAuslesen:
<AppBarButton x:Key="abb_equip_auslesen" Label="Kundenwerte auslesen" Click="KundenwerteAuslesen"/>
EDIT: App reaches Breakpoint at the end of the Contructor, at the end of NavigationHelper_LoadState and at the end of OnNavigatedTo
EDIT: i've changed the target-view to navigate to, but the pronlem still persists, so i assume, that the Problem occurs in the current view