예제 #1
0
 public RingtoneItem(Ringtone ringtone, bool isFavorite = false)
     : this()
 {
     Source = ringtone;
     _viewModel.SetRingtone(ringtone.Source);
     _viewModel.Title = ringtone.Title;
     _viewModel.Icon = ringtone.Icon;
     if (isFavorite) IsFavorite = true;
 }
예제 #2
0
        public static List<Ringtone> GetAllRingtone()
        {
            var list = new List<Ringtone>();
            var resource = Application.GetResourceStream(new Uri("List.txt", UriKind.Relative));

            // Read the file and display it line by line.
            using (var file = new StreamReader(resource.Stream))
            {
                string line;
                while ((line = file.ReadLine()) != null)
                {
                    string[] split = Regex.Split(line, ":");
                    var ringtone = new Ringtone(split[1], split[0]);
                    list.Add(ringtone);
                }
            }
            return list;
        }