Example #1
0
#pragma warning restore CS0649

        public StationStyleForm(IInfo info)
        {
            this.info    = info;
            tt           = info.Timetable;
            attrs        = new TimetableStyle(tt);
            backupHandle = info.BackupTimetable();

            Eto.Serialization.Xaml.XamlReader.Load(this);

            cc = new ColorCollection(info.Settings);
            ds = new DashStyleHelper();

            gridView.AddColumn <Station>(t => t.SName, "Name");
            gridView.AddColumn <Station>(t => cc.ToName(new StationStyle(t).StationColor ?? attrs.StationColor), "Farbe");
            gridView.AddColumn <Station>(t => (new StationStyle(t).StationWidth ?? attrs.StationWidth).ToString(), "Linienstärke");
            gridView.AddColumn <Station>(t => ds.GetDescription(new StationStyle(t).LineStyle), "Linientyp");
            gridView.AddColumn <Station>(t => new StationStyle(t).Show.ToString(), "Station zeichnen");

            gridView.CellDoubleClick += (s, e) => EditColor(false);

            UpdateStations();

            this.AddCloseHandler();
        }
Example #2
0
 public static IIndirectBinding <string> ColorBinding(ColorCollection cc)
 => Binding.Property <string, string>(c => cc.ToName(ColorFormatter.FromHexString(c)));