Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: [Propertygrid] Show/Hide Properties depending on enum

$
0
0
Hello,

I have the following data structure
 public class DailyBackupOptions
    {
        public int EveryXDays { get; set; }
    }

    public class WeeklyBackupOptions
    {
        public List<DayOfWeek> DaysOfTheWeek { get; set; } = new List<DayOfWeek>();

        public int EveryXWeeks { get; set; }
    }

    public enum BackupOption
    {
        Daily,
        Weekly
    }
My Class that is shown in the propertygrid looks as follows:
 public class DbConnection : DbItem
    {
       
        public BackupOption SelectedBackupOption { get; set; }

        public DailyBackupOptions DailyBackupOptions { get; set; } = new DailyBackupOptions();

        public WeeklyBackupOptions WeeklyBackupOptions { get; set; } = new WeeklyBackupOptions();

    }
What i now want to accomplish is that depending on the value of SelectedBackupOption i want to show the properties of my DailyBackupOptions or WeeklyBackupOptions and hide the other one. Is this possible, and if yes, how?

Thanks for helping

Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>