partial void CreateNewTechnicalQuery_Activated() { IContentItemProxy Custproxy = this.FindControl("Customer1"); Custproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s1, e1) => { MatrixControls.NPCustomerInternal custTb = (MatrixControls.NPCustomerInternal)e1.Control; custTb.SelectedItemPath = "SortedCustomers.Customer.CustomerName"; custTb.ItemsSource = this.SortedCustomers; custTb.LostFocus += custTb_LostFocus; }); IContentItemProxy Salesproxy = this.FindControl("MatrixSalesOrderNo"); Salesproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s2, e2) => { MatrixControls.NPSalesOrderNumberInternal sonTb = (MatrixControls.NPSalesOrderNumberInternal)e2.Control; sonTb.SelectedItemPath = "SortedSalesOrderNumbers.SalesOrderNo"; sonTb.ItemsSource = this.SortedSalesOrderNumbers; sonTb.LostFocus += sonTb_LostFocus; }); IContentItemProxy CustOrderNumberproxy = this.FindControl("CustomerOrderNo"); CustOrderNumberproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s2, e2) => { MatrixControls.NPCustomerOrderNumberInternal custONTb = (MatrixControls.NPCustomerOrderNumberInternal)e2.Control; custONTb.SelectedItemPath = "SortedCustomerOrderNumbers.CustomerOrderNumber"; custONTb.ItemsSource = this.SortedCustomerOrderNumbers; custONTb.LostFocus += custONTb_LostFocus; }); }
partial void WebBrowserCtrlDetail910_Activated() { // Write your code here. Property1 = "Type in a URL and the control will update iteself automatically"; IContentItemProxy ctrl = this.FindControl("URL"); ctrl.SetBinding(CentralControlsCS.WebBrowserControl.URIProperty, "Value", System.Windows.Data.BindingMode.OneWay); }
public static void AddCheckBoxColumnForMultiSelection <T>(this IContentItemProxy gridProxy, ObservableCollection <T> selectedItems) where T : class, IEntityObject { EventHandler <ControlAvailableEventArgs> gridProxy_ControlAvailable = null; gridProxy_ControlAvailable = (s1, e1) => { DataGrid dataGrid = e1.Control as DataGrid; var contentItem = dataGrid.DataContext as IContentItem; var visualCollection = (contentItem.Value) as IVisualCollection; dataGrid.LoadingRow += new EventHandler <DataGridRowEventArgs>((s2, e2) => { DataGridColumn column = dataGrid.Columns[0]; var checkBox = column.GetCellContent(e2.Row) as CheckBox; T currentRowItem = e2.Row.DataContext as T; if (currentRowItem != null) { checkBox.IsChecked = selectedItems.Contains(currentRowItem); } RoutedEventHandler checkboxClick = null; checkboxClick = ( (s3, e3) => { var selectedItem = dataGrid.SelectedItem as T; if (selectedItem == null) { return; } if (checkBox.IsChecked ?? false) { if (!selectedItems.Contains(selectedItem)) { selectedItems.Add(selectedItem); } } else { selectedItems.Remove(selectedItem); } TriggerCanExecute(visualCollection); }); checkBox.Click += checkboxClick; }); var col = new DataGridTemplateColumn(); var xaml = @"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""> <CheckBox/> </DataTemplate>"; var dataTemplate = XamlReader.Load(xaml) as DataTemplate; col.CellTemplate = dataTemplate; dataGrid.Columns.Insert(0, col); gridProxy.ControlAvailable -= gridProxy_ControlAvailable; }; gridProxy.ControlAvailable += gridProxy_ControlAvailable; }
partial void AppOptionEdit_Activated() { IContentItemProxy reportingSrv = this.FindControl("AppOptionProperty_ReportingServicesURL"); reportingSrv.SetBinding( ApressControlsCS.WebBrowser.URIProperty, "Value", System.Windows.Data.BindingMode.OneWay); }
public void Initialise() { _window = _screen.FindControl(_dialogName); _window.ControlAvailable += (object s, ControlAvailableEventArgs e) => { var window = (ChildWindow)e.Control; window.Closed += (object s1, EventArgs e1) => { DialogClosed(s1); }; }; }
partial void CreateNewOffice_Activated() { //Listing 11-4. Data-Binding the Slider Control IContentItemProxy buildingCapacity = this.FindControl("BuildingCapacity"); IntToDoubleConverter converter = new IntToDoubleConverter(); buildingCapacity.SetBinding( Slider.ValueProperty, "Value", converter, BindingMode.TwoWay); }
partial void CreateNewIssue_Activated() { //Listing 11-2. Data-Binding a ComboBox Control IContentItemProxy comboControl = this.FindControl("Priority"); comboControl.SetBinding( System.Windows.Controls.ComboBox.ItemsSourceProperty, "Screen.Priorities", System.Windows.Data.BindingMode.OneWay); comboControl.SetBinding( System.Windows.Controls.ComboBox.SelectedItemProperty, "Screen.IssueProperty.Priority", System.Windows.Data.BindingMode.TwoWay); }
partial void ComboBoxControl902_Activated() { // Write your code here. IContentItemProxy comboControl = this.FindControl("Customer"); comboControl.SetBinding( System.Windows.Controls.ComboBox.ItemsSourceProperty, "Screen.Customers", System.Windows.Data.BindingMode.TwoWay); comboControl.SetBinding( System.Windows.Controls.ComboBox.SelectedItemProperty, "Screen.OrderProperty.Customer", System.Windows.Data.BindingMode.TwoWay); }
partial void CreateNewRFI_Activated() { IContentItemProxy Custproxy = this.FindControl("Customer"); Custproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s1, e1) => { MatrixControls.NPCustomerInternal custTb = (MatrixControls.NPCustomerInternal)e1.Control; custTb.SelectedItemPath = "SortedCustomers.Customer.CustomerName"; custTb.ItemsSource = this.SortedCustomers; custTb.LostFocus += custTb_LostFocus; }); IContentItemProxy Salesproxy = this.FindControl("MatrixSalesOrderNo"); Salesproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s2, e2) => { MatrixControls.NPSalesOrderNumberInternal sonTb = (MatrixControls.NPSalesOrderNumberInternal)e2.Control; sonTb.SelectedItemPath = "SortedSalesOrderNumbers.SalesOrderNo"; sonTb.ItemsSource = this.SortedSalesOrderNumbers; sonTb.LostFocus += sonTb_LostFocus; }); IContentItemProxy Recipientproxy = this.FindControl("RFIRecipient"); Recipientproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s4, e4) => { MatrixControls.NPRFIRecipientInternal recTb = (MatrixControls.NPRFIRecipientInternal)e4.Control; recTb.SelectedItemPath = "ClientStaffMember.Name"; recTb.ItemsSource = this.ClientStaffMember; recTb.LostFocus += recTb_LostFocus; }); IContentItemProxy CustOrderNumberproxy = this.FindControl("CustomerOrderNo"); CustOrderNumberproxy.ControlAvailable += new EventHandler <ControlAvailableEventArgs>((s2, e2) => { MatrixControls.NPCustomerOrderNumberInternal custONTb = (MatrixControls.NPCustomerOrderNumberInternal)e2.Control; custONTb.SelectedItemPath = "SortedCustomerOrderNumbers.CustomerOrderNumber"; custONTb.ItemsSource = this.SortedCustomerOrderNumbers; custONTb.LostFocus += custONTb_LostFocus; }); }
partial void HyperlinkButton904_Activated() { // Write your code here. IContentItemProxy product = this.FindControl("ProductName"); targetProperty = "_blank"; ProductID2UriConverter converter = new ProductID2UriConverter(); product.SetBinding(HyperlinkButton.ContentProperty, "Value", BindingMode.OneWay); product.SetBinding(HyperlinkButton.NavigateUriProperty, "Details.Entity.ProductID", converter, BindingMode.OneWay); product.SetBinding(HyperlinkButton.TargetNameProperty, "Screen.targetProperty", BindingMode.OneWay); }
public void Initialise() { _window = _screen.FindControl(_dialogName); _window.ControlAvailable += (object s, ControlAvailableEventArgs e) => { var window = (ChildWindow)e.Control; window.Closed += (object s1, EventArgs e1) => { DialogClosed(s1); }; }; }