예제 #1
0
 public LastFileViewModel(PluginsStudioViewModel mainViewModel, string fileName, int index)
 {
     // Asigna las propiedades
     MainViewModel = mainViewModel;
     FileName      = fileName;
     Index         = index;
     // Asigna el comando
     OpenFileCommand = new BauMvvm.ViewModels.BaseCommand(_ => OpenFile(), _ => CanOpenFile());
 }
예제 #2
0
        /// <summary>
        ///		Crea un menú
        /// </summary>
        public MenuModel Add(string header, BauMvvm.ViewModels.BaseCommand command, string icon, string gestureText = null)
        {
            MenuModel menu = new() {
                Header           = header,
                Command          = command,
                InputGestureText = gestureText,
                Icon             = icon
            };

            // Añade el menú a la colección
            Items.Add(menu);
            // Devuelve el menú añadido
            return(menu);
        }
예제 #3
0
 public LogListItemViewModel(LogListViewModel listViewModel, string type, string content, DateTime createdAt, BauMvvm.ViewModels.Media.MvvmColor color) : base(content, null, false, color)
 {
     // Asigna las propiedades
     ListViewModel = listViewModel;
     Type          = type;
     Content       = content;
     if (content.Length > 200)
     {
         Text = content.Substring(0, 200);
     }
     else
     {
         Text = content;
     }
     if (!string.IsNullOrWhiteSpace(Text))
     {
         Text = Text.Replace("\r\n", " ");
         Text = Text.Replace("\r", " ");
         Text = Text.Replace("\n", " ");
     }
     CreatedAt = createdAt;
     // Asigna los comandos
     ShowDetailsCommand = new BauMvvm.ViewModels.BaseCommand(_ => ShowDetails());
 }