public KeyboardCoreGallery () { var keyboardTypes = new[] { Keyboard.Chat, Keyboard.Default, Keyboard.Email, Keyboard.Numeric, Keyboard.Plain, Keyboard.Telephone, Keyboard.Text, Keyboard.Url }; var layout = new StackLayout (); foreach (var keyboardType in keyboardTypes) { var viewContainer = new ViewContainer<Entry> (Test.Entry.Keyboard, new Entry { Placeholder = keyboardType.ToString (), Keyboard = keyboardType } ); layout.Children.Add (viewContainer.ContainerLayout); } var customKeyboards = new [] { Tuple.Create ("None", Keyboard.Create (KeyboardFlags.None)), Tuple.Create ("Suggestions", Keyboard.Create (KeyboardFlags.Suggestions)), Tuple.Create ("Spellcheck", Keyboard.Create (KeyboardFlags.Spellcheck)), Tuple.Create ("SpellcheckSuggestions", Keyboard.Create (KeyboardFlags.Spellcheck | KeyboardFlags.Suggestions)), Tuple.Create ("Capitalize", Keyboard.Create (KeyboardFlags.CapitalizeSentence)), Tuple.Create ("CapitalizeSuggestions", Keyboard.Create (KeyboardFlags.CapitalizeSentence | KeyboardFlags.Suggestions)), Tuple.Create ("CapitalizeSpellcheck", Keyboard.Create (KeyboardFlags.CapitalizeSentence | KeyboardFlags.Spellcheck)), Tuple.Create ("CapitalizeSpellcheckSuggestions", Keyboard.Create (KeyboardFlags.CapitalizeSentence | KeyboardFlags.Spellcheck | KeyboardFlags.Suggestions)), Tuple.Create ("All", Keyboard.Create (KeyboardFlags.All)), }; foreach (var customKeyboard in customKeyboards) { var viewContainer = new ViewContainer<Entry> (Test.Entry.Keyboard, new Entry { Placeholder = customKeyboard.Item1, Keyboard = customKeyboard.Item2 } ); layout.Children.Add (viewContainer.ContainerLayout); } Content = new ScrollView { Content = layout }; }
public MouseForm(ViewContainer vc) { this.vc = vc; InitializeComponent(); Left = MousePosition.X; Top = MousePosition.Y; if (Right > Screen.FromPoint(MousePosition).WorkingArea.Right) { Left = MousePosition.X- Width; } if (Bottom > Screen.FromPoint(MousePosition).WorkingArea.Bottom) { Top = MousePosition.Y-Height; } ToolTip.SetToolTip(position, "Left click = Select position on screen\nLeft drag = Drag custom size\nRight click = Maximize"); ToolTip.SetToolTip(anchor, "Left click = Change anchor\nRight click = Stretch"); ToolTip.SetToolTip(screens, "Left click = Select screen\nRight click = Original size on selected screen"); ToolTip.SetToolTip(sizes, "Left click = Select size\nRight click = Use original size"); ToolTip.SetToolTip(button1, "Close"); Show(); TopMost = true; }
private void OpenFile(FileInfo file) { _schedulerProvider.Background.Schedule(() => { try { _logger.Info("Attempting to open '" + file.FullName + "'"); RecentFiles.Add(file); //1. resolve TailViewModel var factory = _objectProvider.Get<FileTailerViewModelFactory>(); var viewModel = factory.Create(file); //2. Display it var newItem = new ViewContainer(new FileHeader(file), viewModel); _windowsController.Register(newItem); _logger.Info("Objects for '" + file.FullName + "' has been created."); _logger.Info("Objects for '" + file.FullName + "' has been created."); //do the work on the ui thread _schedulerProvider.MainThread.Schedule(() => { Views.Add(newItem); _logger.Info("Opened '" + file.FullName + "'"); Selected = newItem; }); } catch (Exception ex) { //TODO: Create a failed to load view _logger.Error(ex, "There was a problem opening '" + file.FullName + "'"); } }); }
public void Remove(ViewContainer item) { _views.Remove(item); }
public void Register(ViewContainer item) { _views.AddOrUpdate(item); }
public void Navigate(ViewContainer viewContainer) { throw new NotImplementedException(); }