I can not display a ContentDialog without Borders. If I set BorderBrush="Transparent" or BorderThickness="0 0 0 0" the Borders remain.
Is there any way to get rid of them?
When ContentDialog displays, the properties of BorderBrush and BorderThickness are invisible. To create a border you need to specify custom content that has a border. This post can be helpful.
Besides, there are several other ways to do so:
1) As blueeyes said: You can take some trouble to modify the default ControlTemplate. Here you can find explanations of ContentDialog's style and template
2) You can create an customized user dialog derived from ContentDialog, where you can define your own style. MSDN has a simple example.
Maybe you can work with the ControlTemplateof it there you can change the whole style of it but I warn you just edit a copy of it and it will be a lot of work to do.
Hope my answer helps you :)
There is a tricks which works for me : when you define your ContentDialog (maybe in the code behind), you can override this resource :
Application.Current.Resources["ContentDialogBorderWidth"] = new Thickness(0);
I fund this resource on the style page of ContentDialog of Microsoft here
Related
I'm looking to use a ToggleSwitch in WinUI that has no margin around it. In the template there are two settings called ToggleSwitchPreContentMargin and ToggleSwitchPostContentMargin. I'm looking to override these in my XAML page. I can override them like this, and it works great:
<ToggleSwitch>
<ToggleSwitch.Resources>
<x:Double x:Key="ToggleSwitchPreContentMargin">0</x:Double>
<x:Double x:Key="ToggleSwitchPostContentMargin">0</x:Double>
</ToggleSwitch.Resources>
</ToggleSwitch>
But I would like to set these using a style instead (or any reusable way) so I can assign this only to the ToggleSwitches where I would like this to be applicable, but I don't want to specify the resources like above for each and every toggle switch.
I guess I'd choose between these 2 options:
A. Create a user control with a ToggleSwitch, expose the dependency properties you need and override the margins inside it.
B. Create style with a key, bring the entire template and override the margins inside it.
I am using Template10 with the Hamburger starting project template. I'd like to have a margin between the hamburger area on the left and all content. I tried changing the shared Shell.xaml page (by adding a margin, etc.) but couldn't figure out the best way to sort it out. Conceptually, that makes sense, but it's the specific detail of how to make it work that I'm missing.
Is there an easy way to do it without changing each content page?
Regarding the questions in the comments: I want it in the closed case of a wide view; the question doesn't make any sense in any other case. As far as what I tried, it doesn't really ultimately matter, since none of what I tried worked - I'm asking what the right way is to do it, which I never figured out.
Here's what the default looks like, without a margin:
Here's what it looks like with a margin added to the content area, which is also how the sample template contents handle this:
I don't want to have to mark up every content page with left margins to get the offset in the second picture.
1: https://i.stack.imgur.com/jUIuO.png
Okay, now I have enough information. You have a few options here. The first is just bite the bullet like the rest of the developer community and format your pages like normal. But if you simply must, you can create an implicit Page style with a setter setting Margin="16,16,16,16" but, listen, and I am not kidding, you will ultimately regret it unless your app is super-simple. The biggest problem will be the spacing will be OUTSIDE the containing ScrollViewer.
Thanks for using Template 10.
I have this requirement where I have to change the default styles on my Ext JS application. I am not talking about changing stuff in CSS files yet. I am not that ambitious yet. Here is what I am looking for:
Suppose I need a Submit and Cancel buttons, I use xtype:button and text:Save ( or Cancel ). This will render buttons with the text on them. What should I do if I want to change the look and feel of the button? Or replace the button with a cool Save or Cancel image?
Right now I have all the texts on the application with the default font that ExtJS shows. What am I supposed to do if I want all the text on the application changed to a different font? Everything right from the data in forms/grids and the titles of each component should be changed to some other font my customer prefers. What am I supposed to do?
I understand these are very basic and a generic questions, but I am looking for a good headsup before I proceed with my task.
Thank you all in advance. Waiting for answers :)
Update: So, I found out how we deal with CSS and change the fonts. Can anyone help about the Chaning the look and feel for Submit/Cancel buttons.
I recommend you to use SASS and compass to build your own themes, or better said to change one the existing themes. In the Ext JS documentation you can find the css variables which you can set according to your needs.
If you are not ready for theming with SASS just yet take a look at this example of button configs from the sencha docs:
Stanadalone Example page: http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/button/button.html
CSS that adds customized images to the buttons: http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/button/button.css
JS that shows button configs: http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/button/button.js
Essentially this shows how to use iconCls property on the button config along with a simple CSS class to add desired image to your button.
Small question, anyone have a small example on different data formatting tips when using a RichTextBlock control in Windows8 - XAML?
Currently I'm MVVM binding the Paragraph element of the RichTextBlock to a large text property on my MVVM.
But I was wondering, how can I indicate where to add Line break, setting titles, etc...?
Anyone any good tips on doing this?
I never worked with the RichTextBlock before but there's an interesting topic on the MSDN forum: http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/d215abeb-7acd-41c1-81ba-c73a0ab68785 where an MSFT employee explains you should use the Blocks property.
Now, the Blocks property is of type BlockCollection, meaning it can hold any type of block. In your ViewModel you could fill the property with an HTML string (containing your text with headers, paragraphs, ...). Then you should consider creating an attached behavior that reads the HTML and creates the required blocks (like Windows.UI.Xaml.Documents.Paragraph) to finally fill up the Blocks property.
Take a look at the following guide to create attached behaviors: http://dotnet.dzone.com/articles/dragflickbehavior-windows
<RichTextBlock ...>
<MyBehaviors:Interaction.Behaviors>
<MyBehaviors:RichTextBehavior HtmlText="{Binding ...}"/>
</MyBehaviors:Interaction.Behaviors>
</RichTextBlock>
I am trying to make a custom listview with his items bigger, with an image in the background and a text over it.
I'm trying to use the Kiva example on the docs, but I cannot understand nothing about how is doing that.
Someone could help me understand how to make that? or ar approach to do?
If you want to use sencha-touch 2.0, I think Sencha-touch2.0 guide helps you.
Of course if you want to edit style, you must change via css or template of listview (via listview's tpl attribute).