DockSite hides tool window and workspace border

Docking/MDI for WPF Forum

Posted 2 years ago by Michael Janulaitis - Corner Bowl Software
Version: 22.1.3
Platform: .NET 4.7
Environment: Windows 11 (64-bit)
Avatar

I have the same control which I display in various parts of my application and do not apply any styles.  One of my views is hiding the top row of pixels in the workspace and tool windows.  There is no way I can easily create a sample application as this is deep in my very complex application.  As I am always available to do remote sessions with my customers, I am also available to do a quick remote session with your support team. Here is the docking xaml.  The correct view display my blue border while the bugged views hide the top  pixel:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <docking:DockSite 
            x:Name="dockSite"            
            Grid.Row="0"
            Margin="0"
            Padding="0"
            ToolWindowsHaveTabImages="True"
            ToolItemContainerStyle="{StaticResource ToolWindowStyle}"
			ToolItemTemplateSelector="{StaticResource ToolItemTemplateSelector}"
			ToolItemsSource="{Binding ToolViewModels}">
            <docking:SplitContainer Orientation="Vertical">
                <docking:Workspace>

                    <Grid>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <local:GroupByItemsControl 
                            BorderBrush="Blue"
                            BorderThickness="1" 
                            Grid.Row="0"
                            Visibility="{Binding DisplayGroupBy, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Visible}"/>

                        <local:BaseMessagePreviewDataGrid 
                            Grid.Row="1"
                            x:Name="dataGrid" 
                            ItemsSource="{Binding ItemVMs, Mode=OneWay}"
                            RowDetailsTemplate="{StaticResource MessagePreview}"
                            RowDetailsVisibilityMode="Collapsed"
                            SaveStateEnabled="True" />

                        <local:SpinnerControl 
                            Grid.Row="0" Grid.RowSpan="2"
                            Visibility="{Binding IsWaitingForResult, Converter={StaticResource BooleanToVisibilityConverter}}"/>

                    </Grid>
                </docking:Workspace>
            </docking:SplitContainer>
        </docking:DockSite>
    </Grid>

[Modified 2 years ago]

Comments (11)

Posted 2 years ago by Michael Janulaitis - Corner Bowl Software
Avatar

I have a reproduceable scenario.  Higher in my view, I display a datagrid.  If I hide the datagrid the blue border shows properly. This is a totally unrelated control outside the scope of the control that houses the docksite.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Based on what you've written I don't necessarily think this is anything caused by us.  In WPF, controls might align to non-pixel bounds.  You said you have a DataGrid above the DockSite.  If you give that DataGrid a * available height and it measures itself to something like 50.25 tall, that means controls under it will aligh starting at 50.25 and all be off pixel bounds from that point on.  Then if you have a control in there that use UseLayoutRounding set on, it will try to put itself on integer bounds.  It could be that your entire DockSite is pushed down to non-integer bounds but some control in it is using layout rounding so it ends up overlaying some other controls and mostly hiding the blue border.  That's my guess since you said hiding the DataGrid above prevents the issue.

My suggestion would be set UseLayoutRounding on the DataGrid above and see if that fixes the issue.


Actipro Software Support

Posted 2 years ago by Michael Janulaitis - Corner Bowl Software
Avatar

If I add a border to the docksite I can see the border.  Then just below the border there is a transparent line across the entire docksite covering up my blue border and the top border on my toolwindow.  So it ends up that I can see the entire docksite but not the first line within the docksite.  Does that make sense?

[Modified 2 years ago]

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michael,

Without seeing it happen in a new simple sample project that we can debug with, it's hard to say what's causing it.  Per our previous reply, our guess is it's something with your layout that is causing off-pixel sizing somehow.  But again, we can't be positive of that without debugging a sample.  You can try and reproduce it in a new project with just basic empty controls and no backend functionality or other libraries.  If you can do that, then feel free to send it to our support address, referencing this thread, and excluding the bin/obj folders from the .zip you send.  Then we will have a look at that.


Actipro Software Support

Posted 2 years ago by Michael Janulaitis - Corner Bowl Software
Avatar

Well I can be easily reached via a teams session and I can show you.  It will take less than 5 minutes.  I can't do all your work for you.  I have my own bugs to fix and features to add.  It is clearly a bug in the measurement code within the docksite (or base class of the docksite). Like you said, it's likely a rounding error.  If you like, I can send you a screen shot of the docksite with a one pixel border and then the internals losing the top row of pixels.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

We have been trying to reproduce this with our own samples based on the XAML you provided and have not been able to recreate it. That's the reason we were asking if you were able to reproduce it in a simple sample project. Its only because we can't recreate the issue ourselves that we are asking for your assistance in doing so.

If you could provide a screen shot of the issue, that might reveal some aspect of your overall layout we have not yet considered. Our forums do not support attaching a screen shot, so you could either paste a link to an externally hosted site or email our support address with the attachment and reference this post.


Actipro Software Support

Posted 2 years ago by Michael Janulaitis - Corner Bowl Software
Avatar

I have sent support a screen shot along with the xaml the created the screenshot.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for the screenshot.  Per the screenshot, I think that one of your controls above the nested DockSite is likely causing a non-integer measurement that throws things off below it in a *-sized row where the DockSite is, and triggers anti-aliasing.  You said the following above, which also goes along with that thought:

Higher in my view, I display a datagrid.  If I hide the datagrid the blue border shows properly. This is a totally unrelated control outside the scope of the control that houses the docksite.

Looking at the screenshot, even the View button's row seems to be vertically off pixels as the top/bottom borders are anti-aliased.  If the DataGrid you mentioned is the control right above that, then it is likely the cause.

I'm not sure what your XAML above the nested DockSite is, but I would suggest setting WPF's UseLayoutRounding="True" on the controls above the nested DockSite.  For instance, if you have a StackPanel containing everything from your red background header down to the "View" button's row, then just set UseLayoutRounding="True" on the StackPanel.  Or even try setting it just on the DataGrid.  Please see if any of that does the trick to resolve this and report back.


Actipro Software Support

Posted 1 year ago by Michael Janulaitis - Corner Bowl Software
Avatar

I have sent you another screenshot where I have manually added a red border around my wrapper view and it is fully visible.  As soon as I remove the red border I see the dock site with the missing top row of pixels.  So it seems the wrapper view is drawing properly but the docksite has some rounding issue.  None of my other controls have this issue.  It is limited to the docksite.

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I'm sorry but we didn't receive anything with additional screenshots.  Are you sure you used our support e-mail address?  And did you try the suggestions we made in the previous reply?

Regardless, please reproduce the issue in a new simple sample project and send it to our support address, excluding any bin/obj folders in the .zip you send.  We need to be able to reproduce and debug with it here to be able to give any more help beyond the suggestions we already provided.  You should be able to duplicate the scenario with basic controls by sizing them the same as the controls in your real application.


Actipro Software Support

Posted 1 year ago by Michael Janulaitis - Corner Bowl Software
Avatar

Thanks so much for the detailed exlaination of:

UseLayoutRounding="True"

I have added this to the root window in my application and now all drawing issues have been resolved.

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.