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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Style Trigger On Custom DependencyProperty

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :WPF

Hello all.

I'm having trouble setting a Style Trigger on a custom DependencyProperty I have set up in a UserControl.

Here is my "DragWidth.xaml":

<UserControl x:Class="TouchScreenTest.Controls.DragWidget"

View Complete Post

More Related Resource Links

DataGrid: Tailor Your DataGrid Apps Using Table Style and Custom Column Style Objects


One of the most enduring challenges in writing user interfaces is figuring out how to display large amounts of data efficiently and intuitively without bewildering the user. The problem becomes particularly thorny when the interface must reflect hierarchical relationships within the data that the user needs to modify. The Windows Forms DataGrid control gives developers a powerful and flexible tool to meet this challenge. This article explains its basic operations and shows how to extend the DataGrid to display columns of data in an application-appropriate manner.

Kristy Saunders

MSDN Magazine August 2003

Defining a custom style for a derived DataGrid

Hi all, Please tell me what I could be missing here. I am trying to define a very basic style for a derived DataGrid and it doesn't seem to take! In my dll project, I have this in the Generic.xaml: <Style TargetType="{x:Type local:MyDataGrid1}" BasedOn="{StaticResource {x:Type DataGrid}}"> <Setter Property="RowBackground" Value="#AAEAEFF4"/> <Setter Property="AlternatingRowBackground" Value="#00FFFFFF"/> </Style>  .. and this is how the derived grid is currently (pretty empty until I have this figured out): public class MyDataGrid1 : DataGrid   {     static MyDataGrid1()     {       DefaultStyleKeyProperty.OverrideMetadata(typeof(MyDataGrid1), new FrameworkPropertyMetadata(typeof(MyDataGrid1)));     }   } And in my Sample App's MainPage.xaml, I simply have this: <mygrids:MyDataGrid1 x:Name="dataGrid1" /> But, the alternating colors are not applied! Interestingly, in debugger I see that the properties are set to these values in this instance, but the for some reason while rendering, these values were not used! Please help. Thanks

Style Trigger or or Control Template to swap GradientStops


I have an Ellipse that is part of a UserControl.

     <GradientStop Color="{Binding Path=CommandBg, FallbackValue=DarkBlue}" Offset="{Binding Path=CommandGradient,FallbackValue=2}" />
     <GradientStop Color="White" Offset="0" />

The Grid Has two events:


And on the mouse down event I want to swap the GradientStop properties, and then on MouseUp, swap them back.

How can this be accomplised in XAML?



Cant adjust Box size in Custom view with Box style implemented in sharepoint



i have a sharepoint view which has boxed style implemented to it. It displayes information in form of two boxes adjacent to each other on the site. the issue i am facing is that the two boxes are of unequal size. The left size box takes enough space and hence the box adjacent box has to squeez in the left over space.

how can i customise those according to  my needs. any help would be appreciated.

Thanks in advance



How to use a custom Property in style


hi, i have Class like that;

class CASUICombobox : System.Windows.Controls.ComboBox  

        private bool m_bShowShadow = false;
        public bool ShowShadow
            get { return m_bShowShadow; }
            set { m_bShowShadow = value; CreateShadow(); }

        DropShadowEffect m_Shadow;

        private void CreateShadow()
            if (ShowShadow && m_Shadow == null)
                m_Shadow = new DropShadowEffect();
                m_Shadow.ShadowDepth = 3;

How to drop Activities in Custom Activity Designer having custom style template?



I have designed a custom activity designer developed using Activity Designer XAML and using that in a rehosted Workflow environment on a WPF. I have changed the outer design of the Activity designer by setting the style template to my required style. If I do this, I am unable to add the activities to the custom activity having my custom activity designer.

Am I missing anything.? Please help me in this regard.

Thanks in advance,



How Can I deploy custom ItemStyle xsl into Style Library without SharePoint Designer



I'm using WSPBuilder to develop one custom site, and now when I use Content Query Web Part to show my custom fields. Also, I have modified the ItemStyle.xsl and tried to deploy it into Style Library\XSL Style Sheet folder, but nothing affect. Still I can not retrieve my customized template name in

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

 <Module Name="BerryInternetStyle" List="116" Url="Style Library/XSL Style Sheets" Path="" RootWebOnly="FALSE">
  <!--<File Url="upzoneItemStyle.xsl" Type="GhostableInLibrary"/>-->
  <File Url="ItemStyle.xsl" Type="GhostableInLibrary" IgnoreIfAlreadyExists="true"/>

I also tried to set IgnoreIfAlreadyExists false, but failed.

So anybody could help me? how to deploy this ItemStyle.xsl into SharePoint then let CWQP retrieve its definition about Style Sheet.

Or Is there another solution that SharePoint can retrieve Style Template without ItemStyle.xsl file?




Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Writing custom MembershipProvider

ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

A Simple and Extensible Radio Button Style GridView

The GridView is one of the significant controls in ASP.NET 2.0 and later versions. No doubt it reduces a lot of work time. However, customizing the GridView control is not an easy task. For example, it's hard to add a radio button column to the GridView. This article demonstrates the reason why a radio button column cannot act as normal and how to create a simple and extensible radio button GridView.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Write Custom WebParts for SharePoint 2007

The popularity of SharePoint Portal Server 2003 led Microsoft to tightly integrate the next SharePoint version, Microsoft Office SharePoint Server (MOSS) 2007, with its ASP.NET 2.0 WebPart framework. This tight integration enables the ASP.NET and SharePoint developer to do a number of things that previously weren't possible

Writing Custom Web Parts for SharePoint 2007

As I mentioned in an earlier blog post, SharePoint 2007 is built on top of ASP.NET 2.0, which means you can now use ASP.NET 2.0 features (Forms Authentication, Master Pages, Membership, Site Navigation, New Data Controls, etc) when building SharePoint sites. This is true for both the new Windows SharePoint Services 3.0 version (which will be a free download) as well as Microsoft Office SharePoint Server 2007 (which costs money).

Custom views on .aspx webpage


Hi again, i have a client that needs me to create a custom view on thier webpage similar to Microsoft Word.

It goes about that, when I click on an image it redirects me to another page and must create a custom view for a certain paragraph on that page. I am not sure how to do this and wonder if anyone knows how.

I am using C# programming language if that helps at all. I Heard that using javascript would work but i dont know javascript yet so is there any alternative?

Gmail style multiple Sign-in type combo...is it possible in asp.net?


I am developing a multi-company application and want my users to give the functionality like the following to switch companies.


Is this possible? then how?

Please help


Set Custom Paper size in C#.net 3.5


Dear All,

I have to set custom paper size 6X8 inches

plz tell sugest me code how to do it.

in C#.net 3.5

i m using Asp.net 3.5 Crystal report

i have to do it programiticlly



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