protected override void OnNavigatedTo( bool cancelled, NavigationEventArgs e) { if (cancelled || _entry != null) { return; } var database = Cache.Database; if (database == null) { this.BackToDBs(); return; } _entry = CurrentEntry.Entry; foreach (var field in _entry.GetFields().Take(3)) { var local = field; var item = new ApplicationBarMenuItem(local.Name); item.Click += (s, _) => SetValue(local.Value); ApplicationBar.MenuItems.Add(item); } }
private void DisplayEntry(Entry entry) { _entry = entry; var config = entry.Protections; txtTitle.IsProtected = config.Title; txtPassword.IsProtected = config.Password; txtUsername.IsProtected = config.UserName; _binding = new EntryBinding(entry); _binding.HasChangesChanged += _binding_HasChangesChanged; _binding.HasChanges = entry.IsNew(); CurrentEntry.Entry = _binding; _binding.HasChanges = entry.IsNew(); UpdateNotes(); DataContext = _binding; }
protected override void OnNavigatedTo( bool cancelled, NavigationEventArgs e) { if (cancelled) { return; } var database = Cache.Database; if (database == null) { this.BackToDBs(); return; } _entry = CurrentEntry.Entry; LoadCurrentState(); }
protected override void OnNavigatedTo( bool cancelled, NavigationEventArgs e) { if (cancelled) { return; } var database = Cache.Database; if (database == null) { this.BackToDBs(); return; } _entry = CurrentEntry.Entry; txtNotes.Text = _entry.Notes ?? string.Empty; }
public void SetupRows() { ResetRows(); EntryBinding entriesBindingList = new EntryBinding(); foreach (STBLXMLEntry entry in Loading.Data.Entries) { if (CurrentFilter == null || !CurrentFilter.Invoke(entry)) { entriesBindingList.Add(new EntryWrapper(entry)); } } BrowserGridView.DataSource = new BindingSource { DataSource = entriesBindingList }; InvokeItemCountUpdateEvent(); InvokeSelectedCountUpdateEvent(); }
protected override void OnNavigatedTo( bool cancelled, NavigationEventArgs e) { if (cancelled) { return; } var database = Cache.Database; if (database == null) { this.BackToDBs(); return; } _entry = CurrentEntry.Entry; _fields = new ObservableCollection <FieldBinding>(_entry.GetFields() .Select(x => new FieldBinding(x))); lstFields.ItemsSource = _fields; }
public DeviceIdentifierEntry() { this.Content = layout = new StackLayout { HorizontalContentAlignment = HorizontalAlignment.Stretch, Padding = 5, Spacing = 5, Items = { new Group { Text = "Vendor ID", Orientation = Orientation.Horizontal, Content = vendorId = new HexNumberBox() }, new Group { Text = "Product ID", Orientation = Orientation.Horizontal, Content = productId = new HexNumberBox() }, new Group { Text = "Input Report Length", Orientation = Orientation.Horizontal, Content = inputReportLength = new UnsignedIntegerNumberBox() }, new Group { Text = "Output Report Length", Orientation = Orientation.Horizontal, Content = outputReportLength = new UnsignedIntegerNumberBox() }, new Group { Text = "Report Parser", Orientation = Orientation.Horizontal, Content = reportParser = new TypeDropDown <IReportParser <IDeviceReport> >() }, new Expander { Header = "Feature Initialization Report", Padding = 5, Content = featureInitReport = new ReportEditor() }, new Expander { Header = "Output Initialization Report", Padding = 5, Content = outputInitReport = new ReportEditor() }, new Expander { Header = "Device Strings", Padding = 5, Content = deviceStrings = new DeviceStringEditor() }, new Expander { Header = "Initialization String Indexes", Padding = 5, Content = initializationStrings = new ByteListEditor() } } }; vendorId.ValueBinding.Bind(EntryBinding.Child(e => e.VendorID)); productId.ValueBinding.Bind(EntryBinding.Child(e => e.ProductID)); inputReportLength.ValueBinding.Bind( EntryBinding.Child(e => e.InputReportLength).Convert <uint>( c => c ?? 0, v => v ) ); outputReportLength.ValueBinding.Bind( EntryBinding.Child(e => e.OutputReportLength).Convert <uint>( c => c ?? 0, v => v ) ); reportParser.SelectedKeyBinding.Bind(EntryBinding.Child(e => e.ReportParser)); featureInitReport.ItemSourceBinding.Bind(EntryBinding.Child <IList <byte[]> >(e => e.FeatureInitReport)); outputInitReport.ItemSourceBinding.Bind(EntryBinding.Child <IList <byte[]> >(e => e.OutputInitReport)); deviceStrings.ItemSourceBinding.Bind(EntryBinding.Child <IDictionary <byte, string> >(e => e.DeviceStrings)); initializationStrings.ItemSourceBinding.Bind(EntryBinding.Child <IList <byte> >(e => e.InitializationStrings)); }