.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

Using MVVM with new Ribbon Control Library

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :WPF
Hi, As new ribbon for wpf http://www.microsoft.com/downloads/details.aspx?FamilyID=2BFC3187-74AA-4154-A670-76EF8BC2A0B4&displaylang=en is officially released, I am looking for a way to use new ribbon control library in my application respecting the MVVM pattern, I used ribbon 2007 repecting MVVM by extending the RibbonCommand with CanExecute and Exceute properties, but Microsoft has dumped RibbonCommand in new release. Any help on new Ribbon with MVVM is appreciated.

View Complete Post

More Related Resource Links

"This control is currently disabled..." Most Library-->Documents ribbon actions are greyed


This started when I just needed to delete a document, I noticed most of the actions on the ribbon for Library-->Documents were greyed out.  The only thing that is not greyed is Upload document.  I have tried with multiple administrator accounts, installed office client on the server, I have tried from multiple clients and get the same thing.  Windows 7 and Office 2010 are on the clients I have tried.

Is it possible I may have missed an explicit permission that even an administrator account (domain admin + SP site collaction/farm admin) does not have?

Localization not working in class library (composite control)



I have a class library called WEM.portal which used Resource files to localise text in my composite controls.

I store my resource files (eg MyResourceFile1.resx) in App_GlobalResources folder and then refer to them using

MyLabel1.text = My.Resources.MyResourceFile1.MyResourceKey1

This is all working ok until I create seperate files for each language such as MyResourceFile1.FR-fr.resx.

I have implemented this throughout my other web applications but the Class Library doesnt seem to want to work the same way

When I load the page it correctly showes the resourced keys which I have done through the web application BUT the resource keys in the composite controls does not seem to pick up the culture code.

Am I missing something stupid. Ive tried

  • changing the Build Action on the resource file to Content and Custom tool to GlobalResourceProxyGenerator
  • Creating a resourceManager but to no avail


Reg File Upload control to upload files from document library


In Field Upload control if we click browse button it allow us to search file in our hard disk but now as per my requirement as soon as user clicks ‘Browse’ button it should point to the document libraries and their files in site.Let me know how could i achieve this?

Thanks & Regards,


Where is the Visual Studio 2008 Web Control Library Template


Does a project exist for grouping user controls? Visual Studio 2005 had this template but it does not appear to exist in 2008.

We will be creating several User Controls and would like them grouped accordingly.


Thanks in advance for any responses.

MVVM and Animation Control

I've been struggling with what should be a fairly straightforward issue...hoping someone's got a solution.I'm using MVVM in a scenario where I'm using a MediaElement in a View. The MediaElement has a Storyboard that I customize using DataBinding. The scenario works well when I'm using EventTriggers to control playback, but I have not discovered how to manipulate things using DataTriggers.My Storyboard consists of a ParallelTimeline, which contains the MediaTimeline (with Source, BeginTime and Duration databound to the ViewModel. I've got two buttons that are attached to the Storyboard in EventTriggers calling PauseStoryboard and ResumeStoryboard. This works well, but it's not the best paradigm for me.I am trying to accomplish a design where, if I have two such Views each containing a MediaElement with this type of Storyboard, when one Storyboard reaches its end point, the other View's MediaElement is triggered to play.I have tried to use a DataTrigger design, but I am having problems freezing the Storyboard because I'm using DataBinding to set some of the Storyboard parameters.Does anyone have any ideas as to how I can control a MediaElement via Storyboard/Timeline using DataTrigger instead of EventTrigger? Am I missing something obvious in MVVM?--- Jim ---

Catch Save Ribbon Event from code-behind for webpart control

Hi there, How can a custom web part catch the Save Ribbon event from code-behind? Thank you, —JoeJoe

Building a user control with MVVM

Hi there, I created a custom user control that retrieve rows from database and will create all the buttons on runtime. My current approach is write all codes in the code behind of user control. And also I add a click event handler to each buttons that created on runtime. When any of the button is clicked, inside the click handler function will raise a RoutedEvent. And at the parent control, I add a handler to the custom user control to handle which button is clicked. The problems is : 1) I don't want to write all codes at the code behind. I tried to create a view model class for the user controls, but I failed to bind the event to view model as I wanted to retrieve the object that call this event. ICommand doesn't provide the information for it. 2) Even if I successful created a view model class, when a click event is triggered, the view model will handle it then it fire another event to user control class then the user control class fire another event to the main parent control. Which I think this is stupid >_< 3) I want to know how to user MVVM in this situation. Thanks & Regards, Rambo Ong

Catch Save Ribbon Event from code-behind for webpart control

Hi there, How can a custom web part catch the Save Ribbon event from code-behind? Thank you, —JoeJoe

How to embed jquery library in ASP.NET Custom Server Control

i created custom server control using jquery. i  embeded  jquery library in the control using following code. but it displays object expected error.  has someone done this before ?   //other code    protected override void RenderContents(HtmlTextWriter output) {    output.Write("<div id=\"bckPopup\"></div>"); }   protected void onInit(EventArgs e) { Page.ClientScript.RegisterClientScriptResource(GetType(), "HelpServerControl.Scripts.jquery-1.4.1.min.js");   string javascript = "<script type='text/javascript'> " +   "$(document).ready(function () { " +   "$('#bckPopup').text(\"loaded\"); " + "});</script>" ;   if (!(Page.ClientScript.IsClientScriptBlockRegistered("bhelp" ))) Page.ClientScript.RegisterStartupScript(this.GetType(), "bhelp" , javascript); base .OnInit(e);   }      

WPF Ribbon Control binding to a VM Ribbon reference

Hi, I have a scenario where I will initialize the Ribbon in XAML but its relatd Tab, group, buttons etc., needs to be coming from VM file , meaning there will be a public property of Ribbon which needs to be set back to the Ribbon that was initialized in XAML like ( I am using WPF provided Ribbon control only)  <r:Ribbon Height="135" VerticalAlignment="Top" Name="mainRibbon" ... > // Above XAML I need to set the RibbonControl which is a public property (having the tabs, gropping, buttons etc., // Since WPF ribbion doesn't have ItemsSource I am struggling to set this ... In the VM file private Ribbon _RibbonControl; public Ribbon RibbonControl { get {      CreateRibbon() //This functon will creates tabs, groups, buttons etc., & adds to _RibbonControl      return _RibbonControl; } } Any help here is greatly appreciated. Prakash.G

windows control library not loading webform

Hi Am using asp.net 2.0 .i am having a windows control library.dll in my webform ,but it is not loading correctly.i have attached the code below. <form id="form1" runat="server">  <object classid="http:controllibrary.dll#controllibrary.UserControl1" id= "myid" height="450" width="800" VIEWASTEXT> </object>  </form> please help me.

User Control that had been taken from external web control library (dll) doesn't see it's javascri

 Hello, I've created the .dll assembly with custom web controls and use it successfuly, but my last control needs a javascript. It is also in the same .dll with the control. The problem: My project doesn't see the javascrip in the externlal assembly. The question: How to tune the visibility of javascripts in the external assembly? Thank you. Serge.    

Problem in tab control with MVVM Pattern

Hi,  Am new to wpfpatter and mvvm also. I have problem, i need to assign the same shortcut key(say alt+N) to two button in different tab. i have used the following code to assign the shortcut. problem in when i click the shortcut key in tab one it will get trigger the tab two button event. --xmal code is     <UserControl.InputBindings>         <KeyBinding Command="{Binding Path=Delete1Command}" Modifiers="Alt" Key="N"></KeyBinding>         <KeyBinding Command="{Binding Path=Delete2Command}"   Modifiers="Alt" Key="N"></KeyBinding>     </UserControl.InputBindings>        <TabControl  Height="100" HorizontalAlignment="Left"  Name="tabControl1" VerticalAlignment="Top" Width="200">             <TabItem Header="tabItem1" Name="tabItem1">                 <Grid>                     <Button Content="Button1" Height="23&q

Binding ListView Control Using MVVM

In this short post I will show you how you can bind the list view control and get the selected value of the list view control using MVVM pattern. For this post I have added one list view control which hold the grid view control in it view and when item is selected in the grid view the selected item is shown at the end of the screen. In the Image 1the selected items are not shown ( only the label fields are shown) but in the Image 2 when user click on any of the item the detail is shown.

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

windows form control library error in asp.net

Can some tell me what is this problem?my windows form control library have the drag and drop.when i open in web, the below error pop out.

Web User control in Class Library


Hello All,


I am trying to build a custom webpart in VS 2008 for MOSS 2007. I am using only class library for that.

How to add web user control in class library and add div tags in class library using C#.net?





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