Skip to content

Commit

Permalink
Merge pull request #1614 from microsoft/fix/demo-xamarin-forms-app
Browse files Browse the repository at this point in the history
Fix Xamarin.Forms demo apps
  • Loading branch information
Anastasia Senyushina authored Dec 29, 2021
2 parents 889c456 + 2a5fc23 commit 85e0cff
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
3 changes: 1 addition & 2 deletions Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ bool ConfirmationHandler()
}
else
{
Current.MainPage.DisplayActionSheet("Crash detected. Send anonymous crash report?", null, null, "Send", "Always Send", "Don't Send");
dialog = Current.MainPage.DisplayActionSheet("Crash detected. Send anonymous crash report?", null, null, "Send", "Always Send", "Don't Send");
}
dialog.ContinueWith((arg) =>
{
Expand All @@ -199,7 +199,6 @@ bool ConfirmationHandler()
Crashes.NotifyUserConfirmation(userConfirmationSelection);
});
});

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Contoso.Forms.Demo.AnalyticsContentPage">
<ScrollView>
<StackLayout Orientation="Vertical">
<StackLayout Padding="16" Orientation="Vertical">
<StackLayout Orientation="Vertical">
<Label Text="Analytics Settings"/>
<Label FontSize="Medium" Text="Analytics Settings"/>
<StackLayout Margin="0, 16, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="Analytics Enabled"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="EnabledSwitchCell" Toggled="UpdateEnabled" />
Expand All @@ -26,12 +26,12 @@
<Label FontSize="Medium" Text="Settings Session"/>
<StackLayout Margin="0, 16, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="Enable Manual Session Tracker"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="EnableManualSessionTrackerSwitch" Toggled="EnableManualSessionTrackerCellEnabled" />
<Switch HorizontalOptions="EndAndExpand" IsToggled="False" x:Name="EnableManualSessionTrackerSwitch" Toggled="EnableManualSessionTrackerCellEnabled" />
</StackLayout>
<Button Text="Start Session" Padding="0, 8, 0, 8" x:Name="StartSessionButton" Clicked="StartSessionButton_Clicked"/>
</StackLayout>
<StackLayout Orientation="Vertical">
<Label FontSize="Small" Text="Country Code Settings"/>
<Label FontSize="Medium" Text="Country Code Settings"/>
<Entry Margin="0, 8, 0, 0" FontSize="Small" HorizontalTextAlignment="Start" x:Name="CountryCodeText"/>
<Button Text="Save Country Code" Padding="0, 8, 0, 8" x:Name="SaveCountryCode" Clicked="SaveCountryCode_Clicked"/>
</StackLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ContentPage Title="App Center" xmlns:local="clr-namespace:Contoso.Forms.Demo" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Contoso.Forms.Demo.AppCenterContentPage">
<StackLayout Orientation="Vertical" Padding="16">
<StackLayout Orientation="Vertical">
<Label Text="App Center Settings"/>
<Label FontSize="Medium" Text="App Center Settings"/>
<StackLayout Margin="0, 16, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="AppCenter Enabled"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="AppCenterEnabledSwitchCell" Toggled="UpdateEnabled" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ScrollView>
<StackLayout Orientation="Vertical" Padding="16">
<StackLayout Orientation="Vertical">
<Label Text="Crashes Settings"/>
<Label FontSize="Medium" Text="Crashes Settings"/>
<StackLayout Margin="0, 8, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="Crashes Enabled"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="CrashesEnabledSwitchCell" Toggled="UpdateEnabled" />
Expand All @@ -25,10 +25,10 @@
<Label FontSize="Small" Text="Properties" HorizontalOptions="StartAndExpand" VerticalOptions="Center" />
<Label FontSize="Small" Text="0" HorizontalOptions="EndAndExpand" VerticalOptions="Center" TextColor="Gray" x:Name="NumPropertiesLabel" />
</StackLayout>
<Button Padding="0, 8, 0, 8" Text="Add Property" Clicked="AddProperty" />
<Button Padding="0, 8, 0, 8" Text="Add Property" Clicked="AddProperty"/>
</StackLayout>
<StackLayout Orientation="Vertical">
<Label Margin="0, 8, 0, 0" Text="Test Crashes"/>
<Label FontSize="Medium" Margin="0, 8, 0, 0" Text="Test Crashes"/>
<Button Padding="0, 8, 0, 8" Text="Generate Test Exception" Clicked="TestException" />
<Button Padding="0, 8, 0, 8" Text="Divide 42 by 0" Clicked="DivideByZero" />
<Button Padding="0, 8, 0, 8" Text="Aggregate Exception" Clicked="AggregateException" />
Expand Down
3 changes: 1 addition & 2 deletions Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ bool ConfirmationHandler()
}
else
{
Current.MainPage.DisplayActionSheet("Crash detected. Send anonymous crash report?", null, null, "Send", "Always Send", "Don't Send");
dialog = Current.MainPage.DisplayActionSheet("Crash detected. Send anonymous crash report?", null, null, "Send", "Always Send", "Don't Send");
}
dialog.ContinueWith((arg) =>
{
Expand All @@ -205,7 +205,6 @@ bool ConfirmationHandler()
Crashes.NotifyUserConfirmation(userConfirmationSelection);
});
});

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Contoso.Forms.Puppet.AnalyticsContentPage" Padding="16">
<ScrollView>
<StackLayout Orientation="Vertical">
<StackLayout Padding="16" Orientation="Vertical">
<StackLayout Orientation="Vertical">
<Label Text="Analytics Settings"/>
<Label FontSize="Medium" Text="Analytics Settings"/>
<StackLayout Margin="0, 16, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="Analytics Enabled"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="EnabledSwitchCell" Toggled="UpdateEnabled" />
Expand All @@ -26,14 +26,14 @@
<Label FontSize="Medium" Text="Settings Session"/>
<StackLayout Margin="0, 16, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="Enable Manual Session Tracker"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="EnableManualSessionTrackerSwitch" Toggled="EnableManualSessionTrackerCellEnabled" />
<Switch HorizontalOptions="EndAndExpand" IsToggled="False" x:Name="EnableManualSessionTrackerSwitch" Toggled="EnableManualSessionTrackerCellEnabled" />
</StackLayout>
<Button Text="Start Session" x:Name="StartSessionButton" Clicked="StartSessionButton_Clicked"/>
<Button Text="Start Session" Padding="0, 8, 0, 8" x:Name="StartSessionButton" Clicked="StartSessionButton_Clicked"/>
</StackLayout>
<StackLayout Orientation="Vertical">
<Label FontSize="Small" Text="Country Code Settings"/>
<Label FontSize="Medium" Text="Country Code Settings"/>
<Entry Margin="0, 8, 0, 0" FontSize="Small" HorizontalTextAlignment="Start" x:Name="CountryCodeText"/>
<Button Text="Save Country Code" x:Name="SaveCountryCode" Clicked="SaveCountryCode_Clicked"/>
<Button Text="Save Country Code" Padding="0, 8, 0, 8" x:Name="SaveCountryCode" Clicked="SaveCountryCode_Clicked"/>
</StackLayout>
</StackLayout>
</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ContentPage Title="App Center" xmlns:local="clr-namespace:Contoso.Forms.Puppet" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Contoso.Forms.Puppet.AppCenterContentPage">
<StackLayout Orientation="Vertical" Padding="16">
<StackLayout Orientation="Vertical">
<Label Text="App Center Settings"/>
<Label FontSize="Medium" Text="App Center Settings"/>
<StackLayout Margin="0, 16, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="AppCenter Enabled"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="AppCenterEnabledSwitchCell" Toggled="UpdateEnabled" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ScrollView>
<StackLayout Orientation="Vertical" Padding="16">
<StackLayout Orientation="Vertical">
<Label Text="Crashes Settings"/>
<Label FontSize="Medium" Text="Crashes Settings"/>
<StackLayout Margin="0, 8, 0, 0" Orientation="Horizontal">
<Label FontSize="Small" HorizontalOptions="Start" Text="Crashes Enabled"/>
<Switch HorizontalOptions="EndAndExpand" IsToggled="true" x:Name="CrashesEnabledSwitchCell" Toggled="UpdateEnabled" />
Expand All @@ -28,7 +28,7 @@
<Button Padding="0, 8, 0, 8" Text="Add Property" Clicked="AddProperty"/>
</StackLayout>
<StackLayout Orientation="Vertical">
<Label Margin="0, 8, 0, 0" Text="Test Crashes"/>
<Label FontSize="Medium" Margin="0, 8, 0, 0" Text="Test Crashes"/>
<Button Padding="0, 8, 0, 8" Text="Generate Test Exception" Clicked="TestException" />
<Button Padding="0, 8, 0, 8" Text="Divide 42 by 0" Clicked="DivideByZero" />
<Button Padding="0, 8, 0, 8" Text="Aggregate Exception" Clicked="AggregateException" />
Expand Down

0 comments on commit 85e0cff

Please sign in to comment.