Trying to customize the WPF-Designer

Stimulsoft Reports.WPF discussion
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Trying to customize the WPF-Designer

Post by PJoyeux »

Same problem when trying to hide some report-components in the toolbox. I tried the following code:

Code: Select all

StiServiceContainer objComponents = StiConfig.Services.GetServices(typeof(StiComponent));
foreach (StiComponent objComponent in objComponents)
	switch ((StiComponentId)objComponent.ComponentId)
	{
		case StiComponentId.StiDataBand:
		case StiComponentId.StiFooterBand:
		case StiComponentId.StiHeaderBand:
		case StiComponentId.StiText:
			break;

		default:
			objComponent.PlaceOnToolbox = false;
			break;
	}
But all components are still visible in the toolbox...
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Trying to customize the WPF-Designer

Post by PJoyeux »

Hi again,

I have now changed my approach.

I now create an own empty window, create an instance of StiWpfDesignerControl and add it to the controls of the window. So I do NOT use DesignWithWpf() anymore.

Before I create the instance of StiWpfDesignerControl I call an own method that shall change the appearance of the Designer, but there are still things that just won't work. In the code below the lines that are highlighted do not seem to work:
Bild 4.png
Bild 4.png (29.6 KiB) Viewed 5595 times
The other lines work. For example the "Code Tab" is hidden and the PropertyLevel of the PropertyGrid is set to "Basic". But why does the rest not work?

What I need is:

1) to be able to remove the ContextMenu and the toolbar from the Dictionary-Tab. The user shall not be able to change anything inside the Dictionary.
2) to remove some of the more complex or very seldom used components from the Toolbox.

This is what I thought my code would do... :-/

Your help would be greatly appreciated here...

Thanks and cheers,
Pascal
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Trying to customize the WPF-Designer

Post by Alex K. »

Hello,

> 1) to be able to remove the ContextMenu and the toolbar from the Dictionary-Tab. The user shall not be able to change anything inside the Dictionary.
> 2) to remove some of the more complex or very seldom used components from the Toolbox.

The issues is fixed.

StiOptions.Designer.Panels.Dictionary.ShowActionsButton
We couldn't reproduce this bug.

Thank you.
Attachments
Capture.PNG
Capture.PNG (5.22 KiB) Viewed 5581 times
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Trying to customize the WPF-Designer

Post by PJoyeux »

Hi,
> 1) to be able to remove the ContextMenu and the toolbar from the Dictionary-Tab. The user shall not be able to change anything inside the Dictionary.
> 2) to remove some of the more complex or very seldom used components from the Toolbox.

The issues is fixed.
What do you mean? Were these bugs that are now fixed? Is there a newer version than 2014.1.1801 or is it fixed in that version already? ( I am currently using 2013.3.1800.0).
StiOptions.Designer.Panels.Dictionary.ShowActionsButton
We couldn't reproduce this bug.
ok, hiding the "Actions Button" does indeed work, sorry for bothering you with this...

Cheers,
Pascal
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Trying to customize the WPF-Designer

Post by Alex K. »

Hello,

The issues is fixed. Solution will be available in the next build which will be available today.

Thank you.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Trying to customize the WPF-Designer

Post by PJoyeux »

Aleksey wrote:Hello,

The issues is fixed. Solution will be available in the next build which will be available today.

Thank you.
Ok thanks for the info! :-)
Unfortunately I ran in another thing you might want to fix.

Using StiWpfDesignerControl on a Window I get "System.NullReferenceException: Object reference not set to an instance to an object" when trying to move the following vertical splitter:
Bild 2.png
Bild 2.png (22.35 KiB) Viewed 5573 times
This is the corresponding Stacktrace:
bei System.Windows.Controls.GridSplitter.OnDragCompleted(DragCompletedEventArgs e)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bei System.Windows.Input.InputManager.ProcessStagingArea()
bei System.Windows.Input.MouseDevice.ChangeMouseCapture(IInputElement mouseCapture, IMouseInputProvider providerCapture, CaptureMode captureMode, Int32 timestamp)
bei System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
bei System.Windows.Input.InputManager.ProcessStagingArea()
bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

This does NOT happen if I call the Editor via DesignWithWpf only if I use StiWpfDesignerControl on a window.

I hope you can find and fix this too...

Thanks and cheers,
Pascal
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Trying to customize the WPF-Designer

Post by HighAley »

Hello.

Sorry, but we couldn't reproduce your issue.
Could you send us sample project which reproduces the issue for analysis.

Thank you.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Trying to customize the WPF-Designer

Post by PJoyeux »

Aleksey Andreyanov wrote: ...
Could you send us sample project which reproduces the issue for analysis.
...
Well there's not much code to this. At runtime I create an instance of a WPF-form using the following style and template:

Code: Select all

    <ControlTemplate x:Key="ReportWindowTemplate" TargetType="Window" >
        <Grid Name="ContainerGrid" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Grid.RowDefinitions/>
            <Grid.ColumnDefinitions/>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Validate" >
                    <MVVMLight:EventToCommand Command="{Binding ValidateEditControl}" PassEventArgsToCommand="True"/>
                </i:EventTrigger>
                <i:EventTrigger EventName="PreviewKeyDown" >
                    <MVVMLight:EventToCommand Command="{Binding KeyDown}" PassEventArgsToCommand="True"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Grid>
    </ControlTemplate>

    <Style x:Key="ReportWindowStyle" TargetType="Window" BasedOn="{StaticResource StandardWindowStyle}" >
        <Setter Property="Template" Value="{StaticResource ReportWindowTemplate}"/>
    </Style>
At runtime I create a WPF-Form and apply the style "ReportWindowStyle". In the Loaded-Event of the window I have the following code:

Code: Select all

ContainerGrid.Children.Add(new StiWpfDesignerControl(aReport));
This works perfectly until one tries to change the width of the right dock (Properties) using the splitter. Then immediatly the error pops up!

As I said before, when the Designer is called via DesignWithWpf() the problem does not occur.

Cheers (and happy new year! :-)
Pascal
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Trying to customize the WPF-Designer

Post by HighAley »

Hello, Pascal.

Sorry, but we couldn't reproduce your issue.
Please, send us a working project which reproduces it.

Thank you.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Trying to customize the WPF-Designer

Post by PJoyeux »

Hi,

I still experience this problem: http://forum.stimulsoft.com/viewtopic.p ... =10#p71220

I can't send you a project, just try to create a project like I have described in http://forum.stimulsoft.com/viewtopic.p ... =10#p71527.

This is really annoying since my users want to see more of the report they are designing and automatically try to reduce the size of the right dock (where the properties are located)...

Any idea?

Pascal
Post Reply