本文整理汇总了C#中MainWindow类的典型用法代码示例。如果您正苦于以下问题:C# MainWindow类的具体用法?C# MainWindow怎么用?C# MainWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MainWindow类属于命名空间,在下文中一共展示了MainWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TacticsController
public TacticsController(MainWindow window, string basePath)
{
mainwindow = window;
tanks = new Tanks(basePath + "\\stamps\\tanks\\tanks.xml");
icons = new Icons(basePath + "\\stamps\\icons\\icons.xml");
maps = new Maps(basePath + "\\maps\\maps.xml", icons);
}
示例2: RemoteHostSelect
public RemoteHostSelect(Core core, MainWindow main)
{
InitializeComponent();
Icon = global::renderdocui.Properties.Resources.icon;
hostname.Font =
hosts.Font =
core.Config.PreferredFont;
m_Core = core;
m_Main = main;
hosts.BeginInit();
// localhost should always be available
if (!m_Core.Config.RecentHosts.Contains("localhost"))
m_Core.Config.RecentHosts.Add("localhost");
foreach (var h in m_Core.Config.RecentHosts)
{
AddHost(h);
}
hosts.EndInit();
}
示例3: Main
public static void Main(string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
示例4: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
_MainWindow = new MainWindow();
_MainWindow.Show();
}
示例5: ThreadFolders
public ThreadFolders(MainWindow mw, List<Folder> listeFolders, DirectoryInfo destinationFolder, string departement)
{
this.mw = mw;
this.listeFolders = listeFolders;
this.destinationFolder = destinationFolder;
this.departement = departement;
}
示例6: BgEditorControl
public BgEditorControl(MainWindow mainWindow)
{
_mainWindow = mainWindow;
InitializeComponent();
_orgColor = SolidColorPicker.SelectedColor ?? Colors.White;
var color = Settings.Default.Get("dcolor", System.Drawing.Color.WhiteSmoke);
SolidColorPicker.SelectedColor = color.ToMediaColor();
ColorAccentButton.Content = LanguageLibrary.Language.Default.accet_color_button;
ApplyChangesButton.Content = LanguageLibrary.Language.Default.apply_changes_button;
ImageScalingLabel.Text = LanguageLibrary.Language.Default.image_scale;
RestoreDefaultButton.Content = LanguageLibrary.Language.Default.restore_defaults_button;
RestoreDefaultArea.Header = LanguageLibrary.Language.Default.group_restore_default;
textBlock.Text = LanguageLibrary.Language.Default.or;
SharebackgroundButton.Content = LanguageLibrary.Language.Default.share_bg;
MyResolutionOption.Content = LanguageLibrary.Language.Default.image_scale_Resolution;
NoneOption.Content = LanguageLibrary.Language.Default.scale_none_opt;
TextBoxHelper.SetWatermark(SelectedFile, LanguageLibrary.Language.Default.select_img);
TextBoxHelper.SetButtonCommandParameter(SelectedFile, "Hello World");
TextBoxHelper.SetButtonCommand(SelectedFile, new SelectImageCommand(this, _mainWindow));
ColorPickerButton.Content = LanguageLibrary.Language.Default.color_picker_button;
SolidColorPicker.ToolTip = LanguageLibrary.Language.Default.solid_color_picker_tooltip;
SolidColorPicker.StandardButtonHeader = LanguageLibrary.Language.Default.solid_color_standard;
SolidColorPicker.AdvancedButtonHeader = LanguageLibrary.Language.Default.solid_color_advanced;
SolidColorPicker.StandardColorsHeader = LanguageLibrary.Language.Default.solid_color_standard_colors;
SolidColorPicker.AvailableColorsHeader = LanguageLibrary.Language.Default.solid_color_available_colors;
PixelateImageLabel.Text = LanguageLibrary.Language.Default.image_pixelate;
}
示例7: AddBookmark
public void AddBookmark(string url, string title, TabView tv, MainWindow mw)
{
if (ItemsCount != 3)
{
bookmarkItem = new BookmarkItem(url, title, tv, mainWindow, this);
Canvas canvas1 = new Canvas();
mainCanvas.Children.Add(canvas1);
Canvas.SetTop(canvas1, RowsCount * 105);
Canvas.SetLeft(bookmarkItem, ItemsCount * 177);
bookmarkItem.Width = bookmarkWidth;
bookmarkItem.Height = bookmarkHeight;
canvas1.Children.Add(bookmarkItem);
ItemsCount += 1;
if (ItemsCount == 3) {
ItemsCount = 0;
RowsCount += 1;
}
if (RowsCount >= 3)
{
mainCanvas.Height = (RowsCount + 1) * 110;
}
}
}
示例8: GetPicturePathConfig
public static string GetPicturePathConfig(PicMode picMode, Orientation orientation, MainWindow wnd)
{
if (wnd == null) return null;
switch (picMode)
{
case PicMode.Wallpaper:
switch(orientation)
{
case Orientation.Landscape:
return wnd.config.wpLandscape;
case Orientation.Portrait:
return wnd.config.wpPortrait;
}
break;
case PicMode.Lockscreen:
switch(orientation)
{
case Orientation.Landscape:
return wnd.config.lcLandscape;
case Orientation.Portrait:
return wnd.config.lcPortrait;
}
break;
}
return null;
}
示例9: SetPicturePathConfig
public static void SetPicturePathConfig(PicMode picMode, Orientation orientation, MainWindow wnd, string value)
{
switch (picMode)
{
case PicMode.Wallpaper:
switch (orientation)
{
case Orientation.Landscape:
wnd.config.wpLandscape = value;
break;
case Orientation.Portrait:
wnd.config.wpPortrait = value;
break;
}
break;
case PicMode.Lockscreen:
switch (orientation)
{
case Orientation.Landscape:
wnd.config.lcLandscape = value;
break;
case Orientation.Portrait:
wnd.config.lcPortrait = value;
break;
}
break;
}
}
示例10: login_Click
private void login_Click(object sender, RoutedEventArgs e)
{
Fixed_management.FixedDataSet fixedDataSet = ((Fixed_management.FixedDataSet)(this.FindResource("fixedDataSet")));
// 将数据加载到表 employees 中。可以根据需要修改此代码。
Fixed_management.FixedDataSetTableAdapters.employeesTableAdapter fixedDataSetemployeesTableAdapter = new Fixed_management.FixedDataSetTableAdapters.employeesTableAdapter();
fixedDataSetemployeesTableAdapter.Fill(fixedDataSet.employees);
System.Windows.Data.CollectionViewSource employeesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("employeesViewSource")));
employeesViewSource.View.MoveCurrentToFirst();
int s = (from c in fixedDataSet.employees where c.number == numberTextBox.Text && c.password == passwordTextBox.Password select c).Count();
var id = from c in fixedDataSet.employees where c.number == numberTextBox.Text && c.password == passwordTextBox.Password select c;
//user_id
foreach (var t in id)
{
Public.user_id = t.employees_ID;
}
if (s > 0)
{
MainWindow newmain = new MainWindow();
Application.Current.MainWindow = newmain;
this.Close();
newmain.Show();
}
else
{
MessageBox.Show( "用户名或密码有误!","提示");
}
}
示例11: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
_container = new UnityContainer();
_container.RegisterInstance<IUnityContainer>(_container);
var locator = new UnityServiceLocator(_container);
ServiceLocator.SetLocatorProvider(() => locator);
_container.RegisterType<UserProvider>(new ContainerControlledLifetimeManager());
_container.RegisterType<IChildViewModelManager, ChildViewModelManager>(new ContainerControlledLifetimeManager());
_container.RegisterType<UserDetailsViewModel>(new ContainerControlledLifetimeManager());
_container.RegisterType<UserListViewModel>(new ContainerControlledLifetimeManager());
var mappingResolver = new MappingViewTypeResolver();
mappingResolver.RegisterTypeMapping<UserDetailsView, UserDetailsViewModel>();
mappingResolver.RegisterTypeMapping<UserListView, UserListViewModel>();
mappingResolver.RegisterTypeMapping<UserDetailsWindow, UserDetailsWindowViewModel>();
_container.RegisterInstance<IViewTypeResolver>(mappingResolver);
var mainVM = _container.Resolve<MainWindowViewModel>();
mainVM.Initialize();
var mainWindow = new MainWindow();
mainWindow.DataContext = mainVM;
mainWindow.Show();
}
示例12: MainWindowViewModel
public MainWindowViewModel(MainWindow _window)
{
window = _window;
RefreshService = new DelegateCommand(Refresh);
window.FileTreeView.SelectItem = new Action<object>(FileTreeSelected);
}
示例13: GuiConfig
public GuiConfig(MainWindow parent)
{
_parent = parent;
_parent.SetIconFromFile("images/icon.png");
this.SetLabelFonts();
}
示例14: InitializeWindow
public void InitializeWindow()
{
Dispatcher rubyThreadDispatcher = Dispatcher.CurrentDispatcher;
Thread thread = new Thread(() =>
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
lock (windowLock)
{
_window = new MainWindow(rubyThreadDispatcher);
_window.Title = Name;
}
_window.Closed += (sender2, e2) => { _window.Dispatcher.InvokeShutdown(); };
_window.Show();
Dispatcher.Run();
});
thread.SetApartmentState(ApartmentState.STA);
thread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
thread.Start();
for (int waited = 0; waited < 1000 && _window == null; waited += 10)
{
Thread.Sleep(10);
}
}
示例15: BgEditorControl
public BgEditorControl(MainWindow mainWindow)
{
_mainWindow = mainWindow;
InitializeComponent();
_orgColor = ColorPreview.Background;
ShowUserImageToggle.Checked += _mainWindow.ToggleButton_OnChecked;
ShowUserImageToggle.Unchecked += _mainWindow.ToggleButton_OnUnchecked;
ShowGlyphsIconsToggle.Checked += _mainWindow.ToggleButton_OnChecked;
ShowGlyphsIconsToggle.Unchecked += _mainWindow.ToggleButton_OnUnchecked;
ShowUserImageToggle.IsChecked = Settings.Default.Get("uimage", true);//Settings.Default.uimage;
ShowGlyphsIconsToggle.IsChecked = Settings.Default.Get("gimage", true);//Settings.Default.gimage;
//Debug.WriteLine(Settings.Default.flyoutloc);
switch (Settings.Default.Get("flyout", Position.Right))
{
case Position.Right:
FlyoutPosSelect.SelectedIndex = 1;
break;
case Position.Left:
FlyoutPosSelect.SelectedIndex = 0;
break;
}
}