Esempio n. 1
0
 private void ApplicationOnCustomizeTemplate(object sender, CustomizeTemplateEventArgs e)
 {
     if (e.Context == TemplateContext.NestedFrame)
     {
         _template = e.Template as ISupportActionsToolbarVisibility;
         if (_template != null)
         {
             var modelViewHideViewToolBar = ((IModelClassHideViewToolBar)View.Model);
             var hideToolBar = modelViewHideViewToolBar.HideToolBar.HasValue && modelViewHideViewToolBar.HideToolBar.Value;
             ((Control)_template).Init += (o, args) => {
                 var actionContainerHolders = new[] { _template.GetFieldValue("ToolBar"), _template.GetFieldValue("ObjectsCreation") }
                 .Cast <ActionContainerHolder>()
                 .Where(containerHolder => containerHolder != null);
                 foreach (var container in actionContainerHolders)
                 {
                     container.Style.Remove(HtmlTextWriterStyle.Visibility);
                     container.Style.Remove(HtmlTextWriterStyle.Display);
                     if (hideToolBar)
                     {
                         ApplyStyle(container);
                     }
                 }
             };
         }
     }
 }
        protected override void SetToolbarVisibility(bool visible)
        {
            ISupportActionsToolbarVisibility template = this.Frame.Template as ISupportActionsToolbarVisibility;

            if (template != null)
            {
                template.SetVisible(visible);
            }
        }
Esempio n. 3
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            ISupportActionsToolbarVisibility visibilityManager = Frame.Template as ISupportActionsToolbarVisibility;

            if (Frame.Template is ISupportActionsToolbarVisibility)
            {
                ((ISupportActionsToolbarVisibility)Frame.Template).SetVisible(false);
            }
            if (Frame.Template is ISupportStoreSettings)
            {
                ((ISupportStoreSettings)Frame.Template).SettingsReloaded -= new EventHandler(HideToolbarForAddressDetailView_SettingsReloaded);
                ((ISupportStoreSettings)Frame.Template).SettingsReloaded += new EventHandler(HideToolbarForAddressDetailView_SettingsReloaded);
            }
        }