1

I have a child Window , and I am displaying it from the code behind as below:

ChildPhotoViewer PhotoViewer = new ChildPhotoViewer();
                PhotoViewer.DataContext = selectedPhoto;
                PhotoViewer.Title = selectedPhoto.strTitle.ToString();
                PhotoViewer.Show();

But While Displaying the child window I am getting the Close Button and a Border thickness arround the Window.

I am able to hide the Close Button but is there a way to hide the thickness(Border) across the child window.

Edit:

![alt text][1]

In the Image , there is border arround image after Collpasing the Close button and making

PhotoViewer.Title = null;
PhotoViewer.HasCloseButton = false;

I want to get rid of that Rectangular Border.

Simsons
  • 12,295
  • 42
  • 153
  • 269

2 Answers2

1

Have you tried:-

PhotoViewer.BorderThickness = new Thickness(0);

Edit

Perhaps you are refering to the title block across the top of the window?

PhotoViewer.Title = null;
PhotoViewer.HasCloseButton = false;

Edit

Third attempt.

The template for ChildWindow place the content in border with a 7 pixel margin. This also has an outer border which has a White background. That is what you are seeing in the image. The only way to eliminate it is to copy the ChildWindow template and edit it.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
0

Depends on what you mean by the Border.

If you have a look at the Documentation you can see there is a border (with a thickness of 1) around the edge of the entire window that can be altered like Anthony mentions.

However there is also the window Chrome which in the default template has a number of borders. To change the thickness of these borders you will need to create a style without the borders being present.

Graeme Bradbury
  • 3,693
  • 22
  • 29