public SettingsForm() { InitializeComponent(); PrepareFormElements(); ShowNotAvailableStuffsOnOrderInsertionSwitch.IsToggled = App.ShowNotAvailableStuffsOnOrderInsertion.Value; ShowNotAvailableStuffsOnOrderInsertionSwitch.Toggled += (sender, e) => { App.ShowNotAvailableStuffsOnOrderInsertion.Value = ShowNotAvailableStuffsOnOrderInsertionSwitch.IsToggled; }; ShowConsumerPriceSwitch.IsToggled = App.ShowConsumerPrice.Value; ShowConsumerPriceSwitch.Toggled += (sender, e) => { App.ShowConsumerPrice.Value = ShowConsumerPriceSwitch.IsToggled; }; if (App.Accesses.AccessToViewPartnerRemainder) { PartnerShowAccountingCycleSwitch_Remainder.IsToggled = App.ShowAccountingCycleOfPartner_Remainder.Value; PartnerShowAccountingCycleSwitch_Remainder.Toggled += (sender, e) => { App.ShowAccountingCycleOfPartner_Remainder.Value = PartnerShowAccountingCycleSwitch_Remainder.IsToggled; }; PartnerShowAccountingCycleSwitch_UncashedCheques.IsToggled = App.ShowAccountingCycleOfPartner_UncashedCheques.Value; PartnerShowAccountingCycleSwitch_UncashedCheques.Toggled += (sender, e) => { App.ShowAccountingCycleOfPartner_UncashedCheques.Value = PartnerShowAccountingCycleSwitch_UncashedCheques.IsToggled; }; PartnerShowAccountingCycleSwitch_ReturnedCheques.IsToggled = App.ShowAccountingCycleOfPartner_ReturnedCheques.Value; PartnerShowAccountingCycleSwitch_ReturnedCheques.Toggled += (sender, e) => { App.ShowAccountingCycleOfPartner_ReturnedCheques.Value = PartnerShowAccountingCycleSwitch_ReturnedCheques.IsToggled; }; } ShowPartnerLegalNameInList.IsToggled = App.ShowPartnerLegalNameInList.Value; ShowPartnerLegalNameInList.Toggled += (sender, e) => { App.ShowPartnerLegalNameInList.Value = ShowPartnerLegalNameInList.IsToggled; }; ShowPartnerGroupInList.IsToggled = App.ShowPartnerGroupInList.Value; ShowPartnerGroupInList.Toggled += (sender, e) => { App.ShowPartnerGroupInList.Value = ShowPartnerGroupInList.IsToggled; }; ShowStuffCodeInOrderInsertForm.IsToggled = App.ShowStuffCodeInOrderInsertForm.Value; ShowStuffCodeInOrderInsertForm.Toggled += (sender, e) => { App.ShowStuffCodeInOrderInsertForm.Value = ShowStuffCodeInOrderInsertForm.IsToggled; }; DefaultPriceListPicker.IsVisible = false; var DefaultPriceListTapGestureRecognizer = new TapGestureRecognizer(); DefaultPriceListTapGestureRecognizer.Tapped += (sender, e) => { DefaultPriceListPicker.Focus(); }; DefaultPriceListLabel1.GestureRecognizers.Add(DefaultPriceListTapGestureRecognizer); DefaultPriceListLabel2.GestureRecognizers.Add(DefaultPriceListTapGestureRecognizer); FillPriceListVersionsAsync(!string.IsNullOrEmpty(App.DefaultPriceListVersionId.Value) ? new Guid(App.DefaultPriceListVersionId.Value) : new Nullable <Guid>()); if (App.DefineWarehouseForSaleAndBuy.Value) { DefaultWarehousePicker.IsVisible = false; var DefaultWarehouseTapGestureRecognizer = new TapGestureRecognizer(); DefaultWarehouseTapGestureRecognizer.Tapped += (sender, e) => { DefaultWarehousePicker.Focus(); }; DefaultWarehouseLabel1.GestureRecognizers.Add(DefaultWarehouseTapGestureRecognizer); DefaultWarehouseLabel2.GestureRecognizers.Add(DefaultWarehouseTapGestureRecognizer); FillWarehousesAsync(!string.IsNullOrEmpty(App.DefaultWarehouseId.Value) ? new Guid(App.DefaultWarehouseId.Value) : new Guid?()); } StuffListGroupingPicker.IsVisible = false; var StuffListGroupingTapGestureRecognizer = new TapGestureRecognizer(); StuffListGroupingTapGestureRecognizer.Tapped += (sender, e) => { StuffListGroupingPicker.Focus(); }; StuffListGroupingLabel1.GestureRecognizers.Add(StuffListGroupingTapGestureRecognizer); StuffListGroupingLabel2.GestureRecognizers.Add(StuffListGroupingTapGestureRecognizer); StuffListGroupingPicker.Items.Clear(); StuffListGroupingPicker.Items.Add(StuffListGroupings[0]); StuffListGroupingPicker.Items.Add(StuffListGroupings[1]); StuffListGroupingPicker.Items.Add(StuffListGroupings[2]); FillStuffListGroupingsAsync(App.StuffListGroupingMethod.Value); var ServerAddressTapGestureRecognizer = new TapGestureRecognizer(); ServerAddressTapGestureRecognizer.Tapped += async(sender, e) => { var SettingsForm_ServerAddress = new SettingsForm_ServerAddress(this, null) { StartColor = Color.FromHex("E6EBEF"), EndColor = Color.FromHex("A6CFED") }; await this.Navigation.PushAsync(SettingsForm_ServerAddress); }; ServerAddressLabel1.GestureRecognizers.Add(ServerAddressTapGestureRecognizer); ServerAddressLabel2.GestureRecognizers.Add(ServerAddressTapGestureRecognizer); ServerAddressLabel2.Text = App.ServerAddress.ReplaceLatinDigits(); var GallaryStuffCountTapGestureRecognizer = new TapGestureRecognizer(); GallaryStuffCountTapGestureRecognizer.Tapped += async(sender, e) => { var SettingsForm_GallaryStuffCount = new SettingsForm_GallaryStuffCount(this) { StartColor = Color.FromHex("E6EBEF"), EndColor = Color.FromHex("A6CFED") }; await this.Navigation.PushAsync(SettingsForm_GallaryStuffCount); }; GallaryStuffCountLabel1.GestureRecognizers.Add(GallaryStuffCountTapGestureRecognizer); GallaryStuffCountLabel2.GestureRecognizers.Add(GallaryStuffCountTapGestureRecognizer); RefreshGallryStuffCount(); var PrinterTapGestureRecognizer = new TapGestureRecognizer(); PrinterTapGestureRecognizer.Tapped += async(sender, e) => { var SettingsForm_Printers = new SettingsForm_Printers(this, null) { StartColor = Color.FromHex("E6EBEF"), EndColor = Color.FromHex("A6CFED") }; await this.Navigation.PushAsync(SettingsForm_Printers); }; PrintersLabel1.GestureRecognizers.Add(PrinterTapGestureRecognizer); PrintersLabel2.GestureRecognizers.Add(PrinterTapGestureRecognizer); PrintersLabel2.Text = App.SelectedPrinter != null?App.SelectedPrinter.Title.ReplaceLatinDigits() : "تعریف نشده"; }
public SettingsForm_PrintersAddEdit(PrinterSettingModel Printer, SettingsForm_Printers SettingsForm_Printers) { InitializeComponent(); TitleLabel = new MyEntry() { LeftRounded = true, RightRounded = true, Placeholder = "عنوان چاپگر", Padding = new Thickness(40, 10), FontSize = 18, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.End }; GridLayout.Children.Add(TitleLabel, 0, 0); Grid.SetColumnSpan(TitleLabel, 2); BluetoothPrinterPicker = new Picker() { VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand }; GridLayout.Children.Add(BluetoothPrinterPicker, 0, 1); BluetoothPrinterLabel = new RightRoundedLabel() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.End, Text = "چاپگر بلوتوث", Padding = new Thickness(40, 10), FontSize = 18 }; GridLayout.Children.Add(BluetoothPrinterLabel, 1, 1); BluetoothPrinterChangeButton = new LeftEntryCompanionLabel() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, FontSize = 18, Text = "..." }; GridLayout.Children.Add(BluetoothPrinterChangeButton, 0, 1); WidthLabel = new MyEntry() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.End, LeftRounded = true, RightRounded = true, Placeholder = "پهنای قابل چاپ(mm)", Padding = new Thickness(40, 10), FontSize = 18 }; GridLayout.Children.Add(WidthLabel, 0, 2); Grid.SetColumnSpan(WidthLabel, 2); DensityLabel = new MyEntry() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.End, LeftRounded = true, RightRounded = true, Placeholder = "تراکم نقاط(dpi)", Padding = new Thickness(40, 10), FontSize = 18 }; GridLayout.Children.Add(DensityLabel, 0, 3); Grid.SetColumnSpan(DensityLabel, 2); FontSizeLabel = new MyEntry() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.End, LeftRounded = true, RightRounded = true, Placeholder = "سایز فونت", Padding = new Thickness(40, 10), FontSize = 18 }; GridLayout.Children.Add(FontSizeLabel, 0, 4); Grid.SetColumnSpan(FontSizeLabel, 2); this.SettingsForm_Printers = SettingsForm_Printers; ToolbarItem_OK = new ToolbarItem(); ToolbarItem_OK.Text = "تایید"; ToolbarItem_OK.Icon = "Save.png"; ToolbarItem_OK.Order = ToolbarItemOrder.Primary; ToolbarItem_OK.Priority = 1; ToolbarItem_OK.Activated += ToolbarItem_OK_Activated; ToolbarItems.Add(ToolbarItem_OK); EditingPrinter = Printer; BluetoothPrinterPicker.SelectedIndexChanged += (sender, e) => { var SelectedDevice = (BluetoothDeviceModel)BluetoothPrinterPicker.SelectedItem; MacID = SelectedDevice.MACID; BluetoothPrinterLabel.Text = SelectedDevice.Name; }; SetEditingPrinter(); }