Exemple #1
0
        //public bool StandBy { get; set; }

        public ListViewMediaItem(media_files mf)
        {
            this.mediaId     = mf.id;
            this.categoriaId = mf.categoria_id;
            this.is_folder   = mf.is_folder;

            StackPanel sp = new StackPanel();

            sp.Orientation = Orientation.Horizontal;

            Label l = new Label();

            l.Content = mf.titulo + "  |  " + mf.file_url;
            l.Margin  = new Thickness(5);

            Image img = new Image();

            img.Height = 22;
            img.Width  = 18;
            BitmapImage bmi;

            if (mf.is_folder)
            {
                bmi = new BitmapImage(new Uri("pack://application:,,,/Resources/folder.ico"));
            }
            else
            {
                bmi = new BitmapImage(new Uri("pack://application:,,,/Resources/cinema.png"));
            }

            img.Source = bmi;

            sp.Children.Add(img);
            sp.Children.Add(l);
            this.Content = sp;

            file_exists = mf.FileExists();
            BrushConverter bc = new BrushConverter();

            if (!file_exists)
            {
                l.Foreground = (Brush)bc.ConvertFrom(AppMAnager.COLOR_ERROR_FOREGROUND);
            }
            else
            {
                l.Foreground = AppMAnager.DefaultLabelForeColor();
            }

            this.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(Item_MouseDoubleClick);
            // this.StandBy = false;
        }
Exemple #2
0
        public void setFileExists(bool val)
        {
            file_exists = val;

            BrushConverter bc = new BrushConverter();

            if (!file_exists)
            {
                l.Foreground = (Brush)bc.ConvertFrom(AppMAnager.COLOR_ERROR_FOREGROUND);
            }
            else
            {
                l.Foreground = AppMAnager.DefaultLabelForeColor();
            }
        }