This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // <summary> | |
| /// This class adds the ability to refresh the list when any property of | |
| /// the objects changes in the list which implements the INotifyPropertyChanged. | |
| /// </summary> | |
| /// <typeparam name="T"> | |
| public class ObservableCollectionEx<T> : ObservableCollection<T> | |
| { | |
| // Override the vent so this class can access it | |
| public override event NotifyCollectionChangedEventHandler CollectionChanged; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using (var br = new BinaryReader(Application.Context.Assets.Open(FileName))) | |
| { | |
| using (var bw = new BinaryWriter(new FileStream("/Folder/" + $"{FileName}", FileMode.Create))) | |
| { | |
| var buffer = new byte[2048]; | |
| var length = 0; | |
| while ((length = br.Read(buffer, 0, buffer.Length)) > 0) | |
| { | |
| bw.Write(buffer, 0, length); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| activity.RunOnUiThread(() => | |
| { | |
| // Some code to run | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void CheckAppPermissions() | |
| { | |
| if ((int)Build.VERSION.SdkInt < 23) | |
| { | |
| return; | |
| } | |
| else | |
| { | |
| if (Context.CheckSelfPermission(Manifest.Permission.ReadExternalStorage) != Permission.Granted | |
| && Context.CheckSelfPermission(Manifest.Permission.WriteExternalStorage) != Permission.Granted) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tran = FragmentManager.BeginTransaction(); | |
| var fragment = new HomeFragment(); | |
| tran.Replace(Resource.Id.FrameContainer, fragment); | |
| tran.SetTransition(FragmentTransit.FragmentFade); | |
| tran.CommitAllowingStateLoss(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetContentView(Resource.Layout.FrameContainer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) | |
| { | |
| Window.ClearFlags(WindowManagerFlags.TranslucentStatus); | |
| Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); | |
| var color = Color.Argb(210, 57, 169, 220); | |
| Window.SetStatusBarColor(color); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static bool CheckConnection() | |
| { | |
| try | |
| { | |
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.microsoft.com"); | |
| request.Timeout = 5000; | |
| request.Credentials = CredentialCache.DefaultNetworkCredentials; | |
| HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | |
| if (response.StatusCode == HttpStatusCode.OK) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TargetType="{x:Type ProgressBar}"> | |
| <Setter Property="Foreground" Value="{StaticResource Primary}"/> | |
| <Setter Property="Background" Value="#EEEEEE"/> | |
| <Setter Property="BorderThickness" Value="0"/> | |
| <Setter Property="Template"> | |
| <Setter.Value> | |
| <ControlTemplate TargetType="{x:Type ProgressBar}"> | |
| <Grid Name="TemplateRoot" SnapsToDevicePixels="true"> | |
| <Rectangle Fill="{TemplateBinding Background}"/> | |
| <Rectangle Name="PART_Track" Margin="0"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Style x:Key="TransparentButtonStyle" TargetType="{x:Type Button}"> | |
| <Setter Property="FocusVisualStyle" Value="{x:Null}"/> | |
| <Setter Property="Background" Value="{x:Null}"/> | |
| <Setter Property="BorderBrush" Value="Transparent"/> | |
| <Setter Property="BorderThickness" Value="1"/> | |
| <Setter Property="Foreground" Value="{StaticResource PrimaryDark}"/> | |
| <Setter Property="HorizontalContentAlignment" Value="Center"/> | |
| <Setter Property="VerticalContentAlignment" Value="Center"/> | |
| <Setter Property="Padding" Value="3"/> | |
| <Setter Property="Template"> |
NewerOlder