.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

< Path > as button content dissapears on re-usage

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :WPF

I'm new on WPF. I'm trying to use a Path as content of a button. The problem is that using the same path on different buttons, the path is only visible on the last one created.

This is the declaration of the path on a ResourceDictionary

<Path x:Key="CloseGeometry" Fill="{StaticResource DefaultForeground}" Stroke="Transparent"
Data="M 4,4 L 4,16 L 16,14 L 16,20 L 30,10 L 16,0 L 16,6 Z">

And this is how I try to use it like button content.

<Button Name="dataEndavantButton" Style="{StaticResource AppButtonStyle}" Content="{StaticResource CloseGeometry}"></Button>

What I'm doing wrong?

Thanks in advance.

View Complete Post

More Related Resource Links

Question on content type usage

Hello, using SPF 2010.  I'm having an issue with SharePoint associating the correct custom content type with an item in the list.  I created the following 6 content types (names simplified to demonstrate issue): Specification Document (parent: Document, custom site fields added: client, processing type, document type) Specification Type 1 (parent: Specification Document, document template points to document library [document: specificationtype1.dotx) Specification Type 2 (parent: Specification Document, document template points to document library [document: specificationtype2.dotx) Specification Type 3 (parent: Specification Document, document template points to document library [document: specificationtype3.dotx) Specification Type 4 (parent: Specification Document, document template points to document library [document: specificationtype4.dotx) Specification Type 5 (parent: Specification Document, document template points to document library [document: specificationtype5.dotx) Now, I created a list named Specification Documents and set Allow management of content types to Yes.  I then added the following custom content types Specification Type 1-5 (not the base Specification Document content type).  Note that I also removed the standard Document content type since it does not apply to this library. Each of the 5 specification

Button inside ListBox does't show content

Hi,   We've made a ControlTemplate that defines a rounded border and some animation on mouseover that is default for our buttons, them we put a ContentPresenter inside this Button, on a layer above that default background so we can change the content of the button depending on where we`re using it. Them, we created a Style (DefaultButtonStyle) that would set the template to our template. And finally, for each diferent button we created a Style (BasedOn the DefaultButtonStyle) that would set a ToolTip and the Content, the Content is a Rectangle with the fill property set using DynamicResource to a DrawingBrush with the image we want for that button. Now, a ListBox uses a DataTemplate that has a button with one of the styles we`ve defined earlier. (Some like a print button for each row on the table).   The big problem is: When we run the program it only shows the image on the last line of the ListBox, all the other lines show the buttons without the Rectangle. Trying to see if we could reproduce the error we`ve noticed that even if its not on a ListBox, if we open 2 instances of the same screen, the button would not show. Is there any limitations on using styles and templates for this? It only bug the Content we added on the Styles with BasedOn the DefaultButtonStyle, the other properties like animations and background (defined in the defaul

Content cutoff in Print preview screen when a print button is clicked from a WPF application in Dell

Hello, I am facing a problem in printing.. I have a WPf+windows application running on the Dell Mini Net book(10") with screen resolution 1366 x 768. I am trying to the print the page with heading, image & some measurements on a 81/2 x 11. the print preview seem to be ok on the desktop(screen resolution 1440 x 900). but when i run same application in dell mini the layout is cutoff, the text is started from the footer area,  the page is not shown completely.. Can any one help me in this regard??   Thanks for the help in advance Archana

Content Type: Visible on New Button

With an existing content type associated to a list, does anyone know how to NOT show a content type on the New menu button of the list toolbar and NOT show it in the content type dropdown box in the edit form, using the object model?  (I need the content type to be associated with the list for existing items, but don't want uses to create new items from it.)

In the UI, you can go into the list settings page and click on 'Change new button order and default content type' link to hide any of the content types (both from the New menu and content type dropdown box).  I've tried a couple of methods, both unsuccessfully.

Where ct equal to the content type associated with the list, I've tried,

ct.Hidden = 

Binding a Button's Content property to an XPath query, Accelerator functionality is lost



I'm using WPF 3.5.

I'm binding a button's Content property to an XPath query, and all is well until I try to make use of the Accelerator feature. 

When I hardcode the text, and place an _ (underscore) in the content, it renders as an accelerator key when the Alt key is pressed.  However, when the content is a binding expression that uses an XPath query, the underscore does not render as an accelerator key.  It simply appears as part of the content. 

Here is some simplified XAML code to illustrate:

<UserControl x:Class="Myapp.UI.Screens.PortalScreens.Portal"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
		<XmlDataProvider x:Key="languageResources" d:IsDataSource="True" Source="Resources\Language\English.xml" />
<Grid x:Name="layoutRoot">
		<Button x:Name="ExitButtonWithHardCodedText" Grid.Row=&quo

Hide ribbon, Hide site content/recycle button. Caledar overlay. Document publishing. Other questions


I have a 2010 farm operational and working well. I had a few questions.

(1) How to disable ribbons from appearing on the top (for anonymous sites).

(2) When I move the mouse over a tab in the top bar, how do I display a banner. It was easy enough in 2007, but I am not sure in 2010.

(3) I have disabled quick launch. But it still displays all site content and recycle bin. Is there a way to not to show those.

(4) Calendar overlay - Is this to display multiple calendars in one calendar using different colors to differentiate them. But if I had calendars in different site collections, then I guess due to the gallery boundary, I cannot calendars from multiple site collections.

(5) Document publishing - For some reason, this was easier in SPS 2007. I am not able to get it to work in 2010. Basically update a web page dynamically from a word document. Could anyone kindly provide a link. Also, would I be able to update a page in one site collection from a document from another site collection.

(6) Is it possible to move a folder/doc from one document library to another in one site collection (without webdav). Further, can I move a document library from one site collection to another.

Please advise. Sorry if I asked too many questions in the same post. I am newbie and this is my first post.



Custom ribbon button on content type not shown in XsltListViewWebPart


Hello all,

As a bit of background: I'm currently busy developing a content type with some kind of status (waiting / in progress / done). I want to make the users life a bit easier to complete an item so I want to add a button to the ribbon that sets the selected items status to "Done".
This works when I go to the list and click on the item (I see my button and it works perfectly). The problem is that this button is not visible when I add a view of this list on the homepage, then suddenly my button does not show.

Does anybody know what can be done to also show the button inside the ribbon of the XsltListViewWebpart? Below is my elements.xml that I use.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  Title="Add a Ribbon Button">
     <Button Id="Ribbon.ListItem.Actions.NewRibbonButton"

management of content types and presence of "new" button


Can someone please explain to me why I must allow management of content types to enable the presence of the "new" button and associated content type templates?  It would seem to me that while setting up the library (adding content types) I would need to allow management of the content type, but once down, I would want to set it to "No" so end users can't mess around with it.

There are no mistakes; every result tells you something of value about what you're are trying to accomplish.

Problem in content deployment path job



I have created a Content Deployment path to copy data from source server to destination server.

And also i have created a job to run this content deployment path.

I made the job to run .But the job status is "PREPARING"  for a while.No change for a long time.

I dont know what might be the cause.

Could anyone help on this please?

Managed path error while click on My Content in SharePoint 2010


i have deleted my site.

To delete the site i have used

I go to My Content Site ->

Site Action -> Delete site.


Now I am not able to create the site again. It gives the error Managed path not defined.


Can anyone please help me out to get the silution?

how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

displaying the url path of a file on button click


Dear All,

I would like to know is it possible to display the full url of a file path on button click.

E.g. on a button click it shows http://www.website.com/images/someimage.jpg

is this possible. pls help 

SharePoint Tutorial - Content Types

SharePoint content types provide users with a way to manage and organize content in a more meaningful way. It's a reusable of settings you want to apply to a particular type of document in a library or item in a list.

Enabling Users to Maintain SharePoint Content

When SharePoint is installed as a corporate intranet, there is a considerable amount of effort involved in maintaining the content to keep the site relevant. As we discussed in the first few parts of this series, SharePoint has many built-in features to reduce the burden on the site administrator.

Some areas of the site usually contain less-dynamic information. Internal memos and corporate policies are common examples of this information. One option for this information is to post these documents in a document library. Documents in a library are often stored in a few different formats: Word, Acrobat (PDF), or HTML. Each of these formats has its drawbacks.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend