public AboutTabVM(AppVM app) : base(app, "About") { var decoder = new IconBitmapDecoder(new Uri("pack://application:,,,/ConfuserEx.ico"), BitmapCreateOptions.DelayCreation, BitmapCacheOption.OnDemand); Icon = decoder.Frames.First(frame => frame.Width == 64); }
public SettingsTabVM(AppVM app) : base(app, "Settings") { app.PropertyChanged += (sender, e) => { if (e.PropertyName == "Project") InitProject(); }; InitProject(); }
public MainWindow() { InitializeComponent(); var app = new AppVM(); app.Project = new ProjectVM(new ConfuserProject()); app.FileName = "Unnamed.crproj"; app.Tabs.Add(new ProjectTabVM(app)); app.Tabs.Add(new SettingsTabVM(app)); app.Tabs.Add(new ProtectTabVM(app)); app.Tabs.Add(new AboutTabVM(app)); DataContext = app; }
void LoadProj(AppVM app) { var args = Environment.GetCommandLineArgs(); if (args.Length != 2 || !File.Exists(args[1])) return; string fileName = Path.GetFullPath(args[1]); try { var xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); var proj = new ConfuserProject(); proj.Load(xmlDoc); app.Project = new ProjectVM(proj, fileName); app.FileName = fileName; } catch { MessageBox.Show("Invalid project!", "ConfuserEx", MessageBoxButton.OK, MessageBoxImage.Error); } }
public ProtectTabVM(AppVM app) : base(app, "Protect!") { documentContent = new Paragraph(); LogDocument = new FlowDocument(); LogDocument.Blocks.Add(documentContent); }
public ProjectTabVM(AppVM app) : base(app, "Project") { }
protected TabViewModel(AppVM app, string header) { App = app; Header = header; }
public ProjectTabVM(AppVM app) : base(app, "项目") { }