Exemple #1
0
        private void checkIsStorage_Checked(object sender, RoutedEventArgs e)
        {
            DataModelDesignerSilverlight dataModelDesignerSilverlight = this.userControl as DataModelDesignerSilverlight;

            if (dataModelDesignerSilverlight != null && dataModelDesignerSilverlight.HasRelations(tableSilverlight.Table))
            {
                Dialog.ShowInformationDialog(SilverlightVisualDesigners.Properties.Resources.Information, SilverlightVisualDesigners.Properties.Resources.TheTableHasRelations, this.LayoutRoot);
                this.checkIsStorage.IsChecked = false;
                return;
            }

            buttonAddField.IsEnabled    = false;
            buttonRemoveField.IsEnabled = false;
        }
Exemple #2
0
        void iConnection_Configure(object sender, MouseDoubleClickEventArgs e)
        {
            IComponent iWidget = sender as IComponent;

            if (iWidget != null)
            {
                if (iWidget.Component.InputDataContext == null && e.WidgetType != WidgetType.MenuForm)
                {
                    Dialog.ShowInformationDialog(SilverlightVisualDesigners.Properties.Resources.InvalidConnectionError, SilverlightVisualDesigners.Properties.Resources.InvalidConnectionMessage, this.LayoutRoot);
                    return;
                }

                IWindow iwindows = null;
                switch (e.WidgetType)
                {
                case WidgetType.ListForm:
                    iwindows = new EditListFormControl(sender as ListFormSilverlight, serviceDocument.DataModel);
                    break;

                case WidgetType.MenuForm:
                    iwindows = new EditMenuFormControl(sender as MenuFormSilverlight, serviceDocument.DataModel);
                    break;

                case WidgetType.ShowDataForm:
                    iwindows = new EditShowDataFormControl(sender as ShowDataFormSilverlight, serviceDocument.DataModel);
                    break;

                case WidgetType.EnterSingleDataForm:
                    iwindows = new EditEnterSingleDataFormControl(sender as EnterSingleDataFormSilverlight);
                    break;

                case WidgetType.Table:
                    iwindows = new EditTableControl(sender as TableSilverlight, this);
                    break;

                default:
                    break;
                }

                // Deshabilitar el Canvas para no capturar más eventos.
                Utils.DisablePanel(this.LayoutRoot);

                UserControl userControl = iwindows as UserControl;
                this.LayoutRoot.Children.Add(userControl);
                Grid.SetColumn(userControl, 2);
                Grid.SetRow(userControl, 1);
                iwindows.Closed += new EventHandler(editControl_Closed);
            }
        }