本文整理汇总了C#中IScreenManager类的典型用法代码示例。如果您正苦于以下问题:C# IScreenManager类的具体用法?C# IScreenManager怎么用?C# IScreenManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScreenManager类属于命名空间,在下文中一共展示了IScreenManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextButton
/// <summary>
/// Initialisiert einen Standard-Button mit Text-Inhalt
/// </summary>
/// <param name="text">Enthaltener Text</param>
/// <returns>Button-Instanz</returns>
public static Button TextButton(IScreenManager manager, string text, string style = "")
{
return new Button(manager, style)
{
Content = new Label(manager) { Text = text }
};
}
示例2: Grid
public Grid(IScreenManager manager, string style = "")
: base(manager, style)
{
Columns = new List<ColumnDefinition>();
Rows = new List<RowDefinition>();
ApplySkin(typeof(Grid));
}
示例3: MouseCaptureScreen
public MouseCaptureScreen(IScreenManager manager)
: base(manager)
{
DefaultMouseMode = MouseMode.Captured;
Background = new BorderBrush(Color.Green);
StackPanel stack = new StackPanel(manager);
Controls.Add(stack);
Label title = new Label(manager)
{
TextColor = Color.White,
Text = "Press ESC to return to Main Screen",
};
output = new Label(manager)
{
TextColor = Color.White,
Text = position.ToString(),
};
stack.Controls.Add(title);
stack.Controls.Add(output);
}
示例4: TabControl
/// <summary>
/// Base Constructor
/// </summary>
/// <param name="manager">ScreenManager</param>
public TabControl(IScreenManager manager)
: base(manager)
{
Manager = manager;
Pages = new ItemCollection<TabPage>();
Pages.OnInsert += OnInsert;
Pages.OnRemove += OnRemove;
tabControlStack = new StackPanel(manager);
tabControlStack.HorizontalAlignment = HorizontalAlignment.Stretch;
tabControlStack.VerticalAlignment = VerticalAlignment.Stretch;
Content = tabControlStack;
tabListStack = new StackPanel(manager);
tabListStack.HorizontalAlignment = HorizontalAlignment.Stretch;
tabListStack.Orientation = Orientation.Horizontal;
tabListStack.Background = TabListBackground;
tabControlStack.Controls.Add(tabListStack);
tabPage = new ContentControl(manager);
tabPage.HorizontalAlignment = HorizontalAlignment.Stretch;
tabPage.VerticalAlignment = VerticalAlignment.Stretch;
tabPage.Margin = new Border(0, 10, 0, 10);
tabPage.Background = TabPageBackground;
tabControlStack.Controls.Add(tabPage);
tabPage.Margin = new Border(0, -50, 0, 0);
ApplySkin(typeof(TabControl));
}
示例5: SoundScreen
/// <summary>
/// Initializes a new instance of the <see cref="SoundScreen"/> class.
/// </summary>
/// <param name="graphicsManager">The graphics manager.</param>
/// <param name="screenManager">The screen manager.</param>
public SoundScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager)
: base(graphicsManager, screenManager, "Ballerburg3D")
{
// Zurück button
zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) };
zurueckMenuEntry.Selected += ZurueckMenuEntrySelected;
musicVolumeSlider = new HSlider(this, new Rectangle(250, 100, 300, 20), screenManager.ApplicationSettings.MusicVolume);
musicVolumeSlider.ValueChanged += OnMusicVolumeChanged;
soundFxVolumeSlider = new HSlider(this, new Rectangle(250, 200, 300, 20), screenManager.ApplicationSettings.FxVolume);
menuEffectsVolumeSlider = new HSlider(this, new Rectangle(250, 300, 300, 20), screenManager.ApplicationSettings.MenuEffectsVolume);
var musicList = new List<string> { "DarkStar", "High Tension", "Tentacle", "Death Row", "Boomerang", "Aus" };
musicSelectButton = new ComboToggleButton(this, "Musik", new Collection<string>(musicList), 0, 0) { Position = new Vector2(20, 100) };
musicSelectButton.Selected += OnMusicButtonSelected;
toggleMenuEffectsActionButton = new OnOffToggleButton(this, "Menueeffekte", true, 0) { Position = new Vector2(20, 200) };
toggleSoundEffectsActionButton = new OnOffToggleButton(this, "Soundeffekte", true, 0) { Position = new Vector2(20, 300) };
ControlsContainer.Add(zurueckMenuEntry);
ControlsContainer.Add(musicVolumeSlider);
ControlsContainer.Add(soundFxVolumeSlider);
ControlsContainer.Add(menuEffectsVolumeSlider);
ControlsContainer.Add(musicSelectButton);
ControlsContainer.Add(toggleMenuEffectsActionButton);
ControlsContainer.Add(toggleSoundEffectsActionButton);
}
示例6: PreferencesViewModel
public PreferencesViewModel(ISettingsProvider settingsProvider, IScreenManager screenManager)
{
this.settingsProvider = settingsProvider;
Screens = new ObservableCollection<DetailedScreen>(screenManager.GetScreens());
Settings = settingsProvider.GetSettings<PopupSettings>();
PlaceScreen();
AvailableColors = new ObservableCollection<AvailableColor>();
var properties = typeof(Colors).GetProperties(BindingFlags.Static | BindingFlags.Public);
foreach (var prop in properties)
{
var name = prop.Name;
var value = (Color)prop.GetValue(null, null);
var availableColor = new AvailableColor(name, value);
if (Settings.FontColor == name)
FontColor = availableColor;
if (Settings.ItemBackgroundColor == name)
ItemBackgroundColor = availableColor;
AvailableColors.Add(availableColor);
}
SaveCommand = new DelegateCommand(SaveSettings);
ResetToDefaultsCommand = new DelegateCommand(() => settingsProvider.ResetToDefaults<PopupSettings>());
VisitCommand = new DelegateCommand(Visit);
}
示例7: InjectionInitialize
private void InjectionInitialize(
IScreenManager screenManager,
IEventManager eventManager)
{
this.screenManager = screenManager;
this.eventManager = eventManager;
}
示例8: StartScreen
public StartScreen(IScreenManager manager)
: base(manager)
{
Background = new BorderBrush(Color.DarkRed);
StackPanel stack = new StackPanel(manager);
Controls.Add(stack);
// Button zur Controls Demo
Button controlScreenButton = Button.TextButton(manager, "Controls", "special"); //Button mit speziellen Style erstellen
controlScreenButton.LeftMouseClick += (s, e) => //Click Event festlegen
{
manager.NavigateToScreen(new SplitScreen(manager)); //Screen wechseln
};
stack.Controls.Add(controlScreenButton); //Button zu Root hinzufügen
// Button zur Mouse Capture Demo
Button capturedMouseButton = Button.TextButton(manager, "Captured Mouse", "special");
capturedMouseButton.LeftMouseClick += (s, e) => manager.NavigateToScreen(new MouseCaptureScreen(manager));
stack.Controls.Add(capturedMouseButton);
Button tabDemoScreen = Button.TextButton(manager, "Tab Demo", "special");
tabDemoScreen.LeftMouseClick += (s, e) => manager.NavigateToScreen(new TabScreen(manager));
stack.Controls.Add(tabDemoScreen);
}
示例9: Checkbox
public Checkbox(IScreenManager manager)
: base(manager)
{
CanFocus = true;
TabStop = true;
ApplySkin(typeof(Checkbox));
}
示例10: Splitter
public Splitter(IScreenManager manager, string style = "")
: base(manager, style)
{
CanFocus = true;
TabStop = true;
ApplySkin(typeof(Splitter));
}
示例11: Button
public Button(IScreenManager manager, string style = "")
: base(manager, style)
{
TabStop = true;
CanFocus = true;
ApplySkin(typeof(Button));
}
示例12: KeyMapper
public KeyMapper(IScreenManager manager)
{
manager.KeyDown += KeyDown;
manager.KeyUp += KeyUp;
manager.KeyPress += KeyPressed;
bindings = new Dictionary<string, Binding>();
}
示例13: MenuScreen
/// <summary>
/// Initializes a new instance of the <see cref="MenuScreen"/> class.
/// </summary>
/// <param name="graphicsManager">The graphics manager.</param>
/// <param name="screenManager">The screen manager.</param>
/// <param name="menuTitle">The menu title.</param>
protected MenuScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager, string menuTitle)
: base(graphicsManager)
{
this.menuTitle = menuTitle;
this.screenManager = screenManager;
TransitionOnTime = TimeSpan.FromSeconds(0);
TransitionOffTime = TimeSpan.FromSeconds(0);
}
示例14: GraphikScreen
/// <summary>
/// Initializes a new instance of the <see cref="GraphikScreen"/> class.
/// </summary>
/// <param name="graphicsManager">The graphics manager.</param>
/// <param name="screenManager">The screen manager.</param>
public GraphikScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager)
: base(graphicsManager, screenManager, "Ballerburg3D")
{
// Zurück button
zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) };
zurueckMenuEntry.Selected += ZurueckMenuEntrySelected;
ControlsContainer.Add(zurueckMenuEntry);
}
示例15: Textbox
public Textbox(IScreenManager manager, string style = "")
: base(manager, style)
{
TextColor = Color.Black;
TabStop = true;
CanFocus = true;
Padding = Border.All(5);
ApplySkin(typeof(Textbox));
}