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

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

Adding a Callback to the Window Title Property

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :WPF
Hi all-   I have a quick question.  I have a customized window, based on the Window object.  Is there a way to create a Callback handler on the Title Property, so that I can basically capture and perform my own customized actions when the Title property is changed?  I have no problems adding custom dependency properties (as below), but adding a callback to an existing property from the base class is where I am a little lost and need guidance.   Thanks for any help. Chris   public class WindowBase : Window { // Several Dependency Properties exist as below, with callbacks which trigger on the change of the property // The trick is to find a way to add a callback to the Title property of Window public string Caption { get { return (string)GetValue(CaptionProperty); } set { SetValue(CaptionProperty, value); } } public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register("Caption", typeof(string), typeof(WindowBase), new PropertyMetadata(OnCaptionChanged));

View Complete Post

More Related Resource Links

adding Window Media Player into IE Toolbar

Hello: I am facing a problem in adding a Window Media Player Control into IE ToolBar. I found a project written in C# on Code Project site that can add a text into IE toolBar. But I can't add the window Media Player into IE. The Project I found constitutes of 2 projects BandOjLib and SampleBars window Application C sharp where the development is happening in it. So what you do in SampleBars project will be embedded into BandObj Project after compilation and start without debugging both BandObj and SampleBars respectively. When I am adding the Window Media Player into TOOLBOX, then to drag it into window Form => it gives me this error: Assembly generation failed -- Referenced assembly 'AxInterop.WMPLib' does not have a strong name. I have tried to give it a strong name but with no vain???? I am sending you the project link http://www.codeproject.com/csharp/dotnetbandobjects.asp?select=1113574&df=100&forumid=3788&noise=1&mpp=50&fr=51#xx1024015xx. So please if you have any advice try to inform me.   Regards, R0nda

How to Get the Title, Description Property of a WebPage

Hi Guys! I'm doing up a search engine & what i want to happen is to get the title and description from the page as in below:<%@ Page Title="WHSCT - Health Care Management Plans" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="healthcare.aspx.vb" Inherits="mainpage" Description="List of care plans under Gynaecology, Obstetrics, NNICU & Paediatrics" %> And here is the code that gets the meta tags:Public Shared Sub GetFileInfo(ByVal FPath As String, ByVal srchFile As Page) Dim fileInform As New FileInfo(FPath) Dim strBldFile As New StringBuilder() Dim fileSize As Decimal = fileInform.Length \ 1024 srchFile.Size = fileSize GetFilePath(FPath, srchFile) If InStr(1, ClassSite.DynamicFilesTypesToSearch, fileInform.Extension, vbTextCompare) > 0 Then m_page.Trace.Warn("Path", String.Format("{0}/{1}", "", srchFile.Path)) GetDynamicFileContent(srchFile) Else GetStaticFileContent(FPath, srchFile) End If If Not srchFile.Contents.Equals("") Then 'Read in the title of the file 'Path.GetFileName(FPath).Substring(0, Path.GetFileName(FPath).LastIndexOf(".")) s

Windows Workflow : Activity Binding Properties Window Ellipses button not visible for one property

I have created a custom activity, when I am using this activity in workflow designer I am not getting the ellipsis button to select a property.  I am getting the ellipses button for first property LongValue while not getting the option for "NavigationUrl" property. This is the code for my custom activity. public partial class SetLongAsResult: Activity {         public SetLongAsResult() { InitializeComponent(); }         public static DependencyProperty LongValueProperty = DependencyProperty.Register("LongValue", typeof(long), typeof(SetLongAsResult));           public static DependencyProperty NavigationUrlProperty = DependencyProperty.Register("NavigationUrl", typeof(string), typeof(SetLongAsResult));           [Description("long value to be returned")]         [Category("Set Result Data")]         [BrowsableAttribute(true)]         [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]         public long LongValue         {             get             {         

How Do I Not Include: myControl.GetType.GetProperty("Text") When No Property Window Setting?

Hi All, Posted below is code I'm using to generate a list of controls that have either a "Text" or "Caption" property. However, for certain controls in the resulting list, the property setting (Text/Caption) does not appear in the "Property Window" of the IDE when that control is selected. One example of this is the Systems.Windows.Forms.PictureBox control. Is there a way I can determine this and if so - how do I exclude these control(s) from my list?     Private Sub cmdValidateControls_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdValidateControls.Click         txtResults.Clear()         For Each ctrl As Object In Me.Controls             LogControl(ctrl)         Next     End Sub     Private Sub LogControl(ByVal ctrlIn As Object)         If System.Diagnostics.Debugger.IsAttached Then             If (Not ctrlIn.GetType.GetProperty("Text") Is Nothing) Or (Not ctrlIn.GetType.GetProperty("Caption") Is Nothing) Then                 txtRes

How can I change the WPF window title bar size through Interop services

Hi all,      I want to use my custom title bar in my custom window. In that need a title bar with more height than default widow title bar height. How can I achieve this through window Interop services???? Thanks in Advance.. Suresh.

SPListItem Title URL property??

Hello, I am not exactly sure how to express this query. I have a list with items, the items have titles. When the title link is clicked, it displays a form. I would like to change this behavior and have it act like a URL to a site page. I have searched for the morning and day and have come up with this: web.AllowUnsafeUpdates = true; SPListItemCollection itemCollection = list.Items; item = itemCollection.Add(f.ServerRelativeUrl,SPFileSystemObjectType.File, "Name of item"); item["Title"] = "Name of item"; SPFieldUrlValue url_value = new SPFieldUrlValue(item["Title"].ToString()); url_value.Url = "http://www.google.com"; item[SPBuiltInFieldId.Title] = url_value; item.Update(); web.AllowUnsafeUpdates = false; Now, that is what many blogs, examples have as 'the way", however when this runs the item title is: http://www.google.com , http://www.google.com and when clicked does not go to google...but the form again.   Do I need a custome content type to express the Title as a URL?  Or does it have this property out of the box? So frustrated, maxwell

Adding XAML via control property

Hi, I'm attempting to create a custom chart control that has 1 or many line series within it. My question is, is it possible to create a property of that control, that when checked in the designer, will automatically add the line series xaml within the chart series? For example, if you click on the "Add Test Series" check box, which is of type boolean, it will then add <chartingToolkit:LineSeries /> into the xaml of the control as well as to the series of the control.   <local:TestChartControl> <chartingToolkit:LineSeries /> </local:TestChartControl>     Thanks  

Changes to Properties in the Property Window not Updating in HTML Control


I'm using VWD 2010 Express and have found that when I change a property like AutoPostBack from within the property window the corresponding tag (<asp:TextBox...>) was not updated with the property change to the tag.

Is there a setting that I can change in the VWD properties that will enable changes through the property window for a control to automatically update the HTML tag for that control?

When adding new calendar item the title field is missing - MOSS 2007



A staff member just noticed that when adding a new item to a vacation calendar we have set-up - the Title column is missing.  They will finish creating the new calendar item and then when they go to edit it the Title column appears and they can fill it in.

Can figure out what caused this or how to fix - any ideas?

When I create a new test calendar the title column is displayed properly when creating new item - so not sure what happened with this calendar.

Hope someone has come across this before.

Thanks so much!

Adding back deleted User Profile Property


I've made a bit of an error. My SharePoint User Synchroniztion was all setup and working with My Sites and My Profile but the address was being duplicated. I removed one of the user profile properties under the contact collection. Now SharePoint can't render the My Profile pages. With logging turned up I get the following:

Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler()

Watson bucket parameters: SharePoint Server 2010, ULSException14, 06d8f9f3 "sharepoint portal server", 0e00129b "14.0.4763.0", b2be5063 "microsoft.office.server.userprofiles", 0e001294 "14.0.4756.0", 4b9b2905 "sat mar 13 05:56:21 2010", 0000082d "0000082d", 00000049 "00000049", 10bc7a81 "propertynotdefinedexception", 37706d61 "7pma"

Microsoft.Office.Server.UserProfiles.PropertyNotDefinedException: Property Not Defined: SPS-Location.  An administrator must create this property in the Profile Administration tool.    at

Problem is if I try to recreate a User Property with the name SPS-Location it won't let me so how do I get this back?



Can we specify ChromeType Property of a web part when adding in SharePoint Designer 2010

Is it possible that with all other properties, we can specify ChromeType Property of a web part while adding it on the page using SharePoint Designer 2010? If yes, any example / syntax?

Programmatically adding user profile properties fails when adding a multivalued property


I have written a console application that adds a custom section to the User Profile Properties and then adds properties under that section. The code works fine when adding CoreProperties of type string (Single Value) and mapping each property to an Active Directory field. However the code always fails when mapping a string (Multi Value) property to an AD property. I have researched the errors I present below but cannot see what the solution might be.


    private static void AddCustomProperties(string strUrl)
      Console.WriteLine("Adding custom properties under section '" + DisplayName + "'.......");
      using (SPSite siteColl = new SPSite(strUrl))

        SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);
        UserProfileConfigManager upcm = new UserProfileConfigManager(serviceContext);
        CorePropertyManager cpm = upcm.ProfilePropertyManager.GetCoreProperties();
        ProfilePropertyManager ppm = up

Set the "Title" property of upload documents to "Name"



When uploading a document to SharePoint  - it taked the name of the file, but the Title is kept empty (or get the property from the WORD meta data, which is not always actual and updated...),

How can i set the title to take the file name by default?

i tryied to edit the column in the parent content type (to take the file name as the default value) but got some errors, and it didn't seem to work.

i'm trying to avoid the creation of a new column but set the basic column of SharePoint


keren tsur

property window



as far as I know, when the mouse hovers over one of the properties of the property window, there is a help line underneath that says what the property highlighted is supposed to do.
It doesn't show up on my property window.
Why is that and how to set it back ?


HOW TO USE Variables in Reports Property window.


Hi all,

I want to how to use Vaibles in Reort which is available in Variables window tab in Reports Property If Provide some Example then its better to understand.



Abhay Sawant

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Adding Rows in GridView without using a Database

This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.
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