本文整理汇总了C#中MainWindow类的典型用法代码示例。如果您正苦于以下问题:C# MainWindow类的具体用法?C# MainWindow怎么用?C# MainWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MainWindow类属于命名空间,在下文中一共展示了MainWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:riskawarrior,项目名称:tacticplanner,代码行数:7,代码来源:TacticsController.cs
示例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();
}
开发者ID:lanphon,项目名称:renderdoc,代码行数:26,代码来源:RemoteHostSelect.cs
示例3: Main
public static void Main(string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
开发者ID:JonathanIvan,项目名称:Practica_5,代码行数:7,代码来源:Program.cs
示例4: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
_MainWindow = new MainWindow();
_MainWindow.Show();
}
开发者ID:hjjohny,项目名称:szfgy1,代码行数:7,代码来源:App.xaml.cs
示例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;
}
开发者ID:unil,项目名称:fbm-tools,代码行数:7,代码来源:ThreadFolders.cs
示例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;
}
开发者ID:farshad-sadri,项目名称:Windows-10-Login-Background-Changer,代码行数:31,代码来源:BgEditorControl.cs
示例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;
}
}
}
开发者ID:amaitland,项目名称:WebExpress-beta,代码行数:25,代码来源:Bookmarks.xaml.cs
示例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;
}
开发者ID:logchan,项目名称:desktop-wallpaper-auto-switch-2,代码行数:26,代码来源:DWAS2Helper.cs
示例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;
}
}
开发者ID:logchan,项目名称:desktop-wallpaper-auto-switch-2,代码行数:28,代码来源:DWAS2Helper.cs
示例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( "用户名或密码有误!","提示");
}
}
开发者ID:cloudtimesoft,项目名称:Fixed_management,代码行数:29,代码来源:Login.xaml.cs
示例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();
}
开发者ID:denis-tsv,项目名称:ViewFirst-vs-ViewModelFirst,代码行数:27,代码来源:App.xaml.cs
示例12: MainWindowViewModel
public MainWindowViewModel(MainWindow _window)
{
window = _window;
RefreshService = new DelegateCommand(Refresh);
window.FileTreeView.SelectItem = new Action<object>(FileTreeSelected);
}
开发者ID:Chang228,项目名称:SDCPublish,代码行数:7,代码来源:MainWindowViewModel.cs
示例13: GuiConfig
public GuiConfig(MainWindow parent)
{
_parent = parent;
_parent.SetIconFromFile("images/icon.png");
this.SetLabelFonts();
}
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:7,代码来源:GuiConfig.cs
示例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);
}
}
开发者ID:gilind,项目名称:workshop,代码行数:29,代码来源:MainWindowWrapper.cs
示例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;
}
}
开发者ID:FreedomDesigns,项目名称:Windows-10-Login-Background-Changer,代码行数:27,代码来源:BGEditorControl.xaml.cs
示例16: PublishBook
/// <summary>
/// publicly exposed class for saving a book to web
/// </summary>
/// <param name="bv">the current bookviewer</param>
/// <param name="folderloc">the folder where the page is being saved</param>
public static void PublishBook(BookViewer bv, string folderloc, MainWindow h)
{
h.SetBackGroundInvisible();
CopyPreSetFiles(folderloc);
RenderPages(bv, folderloc);
h.SetBackGroundVisible();
}
开发者ID:rakuza,项目名称:YBM2012,代码行数:12,代码来源:WebPublisher.cs
示例17: App
public App()
{
var vm = new MainWindowModel();
var view = new MainWindow {ViewModel = vm};
view.ShowDialog();
}
开发者ID:reactiveui-forks,项目名称:ProgNET2014,代码行数:7,代码来源:App.xaml.cs
示例18: MW_ViewModel
public MW_ViewModel(PlaylistViewModel avm,LibraryViewModel lvm, MainWindow mw)
{
_backupVolume = 0;
Volume = DEFAULT_VOLUME;
Mute = false;
_avm = avm;
_lvm = lvm;
_mw = mw;
ClickHandlers = new Dictionary<ButtonType, EventHandler<ActionClickArgs> >();
ButtonClicks = new Dictionary<ButtonType, ICommand>()
{
{ ButtonType.Play, new ButtonClick(new Action(btnPlay_Action)) },
{ ButtonType.Pause, new ButtonClick(new Action(btnPause_Action)) },
{ ButtonType.Next, new ButtonClick(new Action(btnNext_Action)) },
{ ButtonType.Prev, new ButtonClick(new Action(btnPrev_Action)) },
{ ButtonType.Stop, new ButtonClick(new Action(btnStop_Action)) },
{ ButtonType.Open, new ButtonClick(new Action(btnOpen_Action)) },
{ ButtonType.Export, new ButtonClick(new Action(btnExport_Action)) },
{ ButtonType.Import, new ButtonClick(new Action(btnImport_Action)) },
{ ButtonType.Clean, new ButtonClick(new Action(btnClean_Action)) },
{ ButtonType.ImportFolder, new ButtonClick(new Action(btnImportFolder_Action)) },
{ ButtonType.Volume, new ButtonClick(new Action(btnVolume_Action)) }
};
IsPlaying = false;
}
开发者ID:Vyko,项目名称:MyWmp,代码行数:26,代码来源:MW_ViewModel.cs
示例19: LoginPage
public LoginPage(MainWindow _mainWindow)
{
InitializeComponent();
employeeAuthentication = new EmployeeAuthenticationClient();
UserAccountSC = new UserAccountSecureServiceClient();
thisWindow = _mainWindow;
}
开发者ID:PatrykOlejniczak,项目名称:WPK.TransportSystem,代码行数:7,代码来源:LoginPage.xaml.cs
示例20: Main
public static void Main(string[] args)
{
Application.Init ();
try {
InfoManager.Init ();
} catch (Exception e) {
Dialog d = new Dialog ("Error", null, DialogFlags.Modal, new object [] {
"OK", ResponseType.Ok });
d.VBox.Add (new Label ("There was a problem while trying to initialize the InfoManager\n\n" + e.ToString ()));
d.VBox.ShowAll ();
d.Run ();
return;
}
string profile_path = null;
if (args.Length != 0 && args[0].StartsWith ("--profile-path="))
profile_path = args[0].Substring (15);
MainWindow win = new MainWindow (profile_path);
win.Show ();
if (args.Length == 2 && File.Exists (args [0]) && File.Exists (args [1])){
win.ComparePaths (args [0], args [1]);
}
Application.Run ();
}
开发者ID:FreeBSD-DotNet,项目名称:mono-tools,代码行数:26,代码来源:Main.cs
注:本文中的MainWindow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论