Search Results

Search found 215 results on 9 pages for 'nicolas thery'.

Page 9/9 | < Previous Page | 5 6 7 8 9 

  • Remove all html tags from attributes in rails

    - by Hock
    I have a Project model and it has some text attributes, one is summary. I have some projects that have html tags in the summary and I want to convert that to plain text. I have this method that has a regex that will remove all html tags. def strip_html_comments_on_data self.attributes.each{|key,value| value.to_s.gsub!(/(<[^>]+>|&nbsp;|\r|\n)/,"")} end I also have a before_save filter before_save :strip_html_comments_on_data The problem is that the html tags are still there after saving the project. What am I missing? And, is there a really easy way to have that method called in all the models? Thanks, Nicolás Hock Isaza

    Read the article

  • Ajax method within a added method in jQuery validator

    - by nikospkrk
    Hi, I'm kind of stuck with this pretty simple (I'm sure) jQuery/Javascript issue. Here's the code : jQuery.validator.addMethod("emailExists", function(value, element, param) { var email = value || ''; var valid = 0; $.ajax({ type: "POST", url: param, data: "email=" + email, success: function(msg) { if (msg != '' && msg) { valid = 0; } else { valid = 1; } } }); return valid; }, "* Email address already registered, please login."); This function is called where a user type his email address in a registration form, and everything seems to work perfectly, except that my valid variable returned isn't updated, whereas when I use an alert box it is properly done! It looks like it return the value before the AJAX is done, any idea? Cheers, Nicolas.

    Read the article

  • Authlogic Multiple Password Validation

    - by Hock
    Hello, I'm using Authlogic to manage my user sessions. I'm using the LDAP add-on, so I have the following in my users model acts_as_authentic do |c| c.validate_password_field = false end The problem is that recently I found out that there will be some users inside the application that won't be part of the LDAP (and can't be added!). So I would need to validate SOME passwords against the database and the others against the LDAP. The users whose password will be validated against the database will have an specific attribute that will tell me that that password will be validated in my database. How can I manage that? Is it possible that the validate_password_field receives a "variable"? That way I could create some method that will return true/false depending on where the password validation will be done? Thanks! Nicolás Hock Isaza

    Read the article

  • Facebook connect integration (registration & login)

    - by nikospkrk
    Hi, I'm really struggling to make facebook connection working for my system. What I want to do : When the user is not yet registered on facebook : Fetch some user profile fields into my database (ideqally via my registration page already working for non facebook users) Log the user into my website Redirect the user into my homepage What I've done so far : Set up the application in FB Add the Facebook class from the github website and integrate some code to make it working Add additionnal paremeters to login/register facebook link. I'm struggling to redirect the user after authorizing, to my register page (register/?facebook). The "Post-Authorize Redirect URL" field doesn't seem to work properly, I maybe do not fill the right field? My other question is, if my registration page uses a redirection show (index.php redirect to register.php), do the information given by facebook through the $_POST method would be available in the register.php page ? I don't think so, do you ? Regards, Nicolas.

    Read the article

  • PhysX SDK - error LNK2019: unresolved external symbol when compiling "wavefront.cpp"

    - by user370102
    Hi all, I'm using the PhysX SDK and I'm trying to load an .obj file with the WavefrontObj object which is defined by the files "wavefront.h/.cpp", localized in the samples directory. When I'm compiling my project, I got this error: 1Linking... 1wavefront.obj : error LNK2019: unresolved external symbol "char * __cdecl FindMediaFile(char const *,char *)" (?FindMediaFile@@YAPADPBDPAD@Z) referenced in function "public: void __thiscall WAVEFRONT::InPlaceParser::SetFile(char const *)" (?SetFile@InPlaceParser@WAVEFRONT@@QAEXPBD@Z) 1C:\Users\Nicolas\Documents\GI05\CSED451 - Computer Graphics\ToyFK_Project\Debug\ToyFK_Project.exe : fatal error LNK1120: 1 unresolved externals I guess I forgot to link a library or something but I really can't find what... It's driving me crazy!!! Does somebody have an idea? Thank you

    Read the article

  • Replace input type=file by an image

    - by nikospkrk
    Hi, Like a lot of people, I'd like to customize the ugly input type=file, and I know that it can't be done without some hacks and/or javascript. But, the thing is that in my case the upload file buttons are just for uploading images (jpeg|jpg|png|gif), so I was wondering if I could use a "clickable" image which would act exactly as an input type file (show the dialog box, and same $_FILE on submitted page). I found some workaround here, and this interesting one too (but does not work on Chrome =/). What do you guys do when you want to add some style to your file buttons? If you have any point of view about it, just hit the answer button ;) Cheers, Nicolas

    Read the article

  • Java Spotlight Episode 58: Peter Korn and Ofir Leitner on ME Accessibility

    - by Roger Brinkley
    Tweet Interview with Peter Korn and Ofir Leitner on Mobile and Embedded Accessibility. Joining us this week on the Java All Star Developer Panel are Dalibor Topic, Java Free and Open Source Software Ambassador and Alexis Moussine-Pouchkine, Java EE Developer Advocate. Right-click or Control-click to download this MP3 file. You can also subscribe to the Java Spotlight Podcast Feed to get the latest podcast automatically. If you use iTunes you can open iTunes and subscribe with this link: Java Spotlight Podcast in iTunes. Show Notes News Announcing Oracle WebLogic 12c Geronimo 3 beta - Another Apache project now compatible with Java EE 6 NetBeans 7.1 RC1 is out JavaFX links of the weeks JavaFX videos on Parleys: Nicolas Lorain's Introduction to JavaFX 2.0 from JavaOne 2011 & Richard Bair on JavaFX Architecture and Programming Model Events Dec 4, SOUJava Geek Bike Ride 2011, Sao Paulo  Dec 5-7, UKOUG, Birmingham, UK Dec 6-8, Java One Brazil, Sao Paulo Dec 9 UAIJUG, Uberlandia Dec 9 CEJUG, Fortaleza/CE Dec 10 GUJAVA, Florianopolis Dec 10 ALJUG, Maceio/AL Dec 11 Javaneiros, Campo Grande/MS Dec 12 GOJAVA, Goiania/GO Dec 13 RioJUG, Rio de Janeiro Feature interview Peter Korn is Oracle's Accessibility Principal – their senior individual contributor on accessibility. He is also Technical Manager of the AEGIS project, leading an EC-funded €12.6m investment building accessibility into future mainstream ICT (FP7-ICT224348). Mr. Korn co-developed and co-implemented the Java Accessibility API, and developed the Java Access Bridge for Windows. He helped design the open source GNOME Accessibility architecture found on most modern UNIX and GNU/Linux systems, and consulted on accessibility support for OpenOffice.org, Firefox, Thunderbird, and other applications. Prior to Sun/Oracle, Peter co-developed the outSPOKEN for Windows screen reader. Mr. Korn represented Sun/Oracle on TEITAC for the Section 508/255 refresh, co-led the OASIS ODF Accessibility subcommittee, and sits on INCITS V2 where he is contributing to ISO 13066: defining AT-IT interoperability standards including specifically the Java Accessibility API. Ofir Leitner is the architect of one of LWUIT's key features - the HTMLComponent which allows rendering HTML within LWUIT applications and to embed web-flows inside apps. Ofir is also responsible for LWUIT's bidirectional and RTL support and for the accessibility work that is being done these days in LWUIT. Mail Bag What's Cool Devoxx 2011 (Alexis) Eclipsecon Europe Talk by Andrew Overholt: IcedTea & IcedTea-Web Geek bike ride & Rio 500 Twitter followers @JavaSpotlight Show Transcripts Transcript for this show is available here when available.

    Read the article

  • Speaking at Mix11

    - by Dennis Vroegop
    In April Microsoft will hold the next MIX event. MIX was usually targeted at web designers and developers but has grown over the years to be more a general conference focused on the web and devices. In other words: everything the normal consumer might encounter. It’s not your typical developers conference, although you’ll find many developers there as well. But next to the developers you’ll probably run into designers and user experience specialists as well. This year I am proud to say that I will be one of the people presenting there. Together with all the Surface MVP’s in the world (sounds impressive, but there are only 7 of us) we’ll host a panel discussion on all things Surface, NUI and everything else that matches those subjects. Here’s what the abstract says: The Natural User Interface (NUI) is a hot topic that generates a lot of excitement, but there are only a handful of companies doing real innovation with NUIs and most of the practical experience in the NUI style of design and development is limited to a small number of experts. The Microsoft Surface MVPs are a subset of these experts that have extensive real-world experience with Microsoft Surface and other NUI devices. This session is a panel featuring the Microsoft Surface MVPs and an unfiltered discussion with each other and the audience about the state of the art in NUI design and development. We will share our experiences and ideas, discuss what we think NUI will look like in the near future, and back up our statements with cutting-edge demonstrations prepared by the panelists involving combinations of Microsoft Surface 2.0, Kinect, and Windows Phone 7. We, as Surface MVPs think we are more than just Surface oriented. We like to think we are more NUI MVP’s. But since that’s not a technology with Microsoft you can’t actually become a NUI MVP so Surface is the one that comes the closest. We are currently working on the details of our session but believe me: it will blow you away. Several people we talked to have said this could potentially be the best session of Mix. Quite a challenge, but we’re up for it! Of course I won’t be telling you exactly what we’re going to do in Las Vegas but rest assured that when you visit our session you’ll leave with a lot of new ideas and hopefully be inspired to bring into practice what you’ve seen. Even if the technology we’ll show you isn’t readily available yet. So, if you are in Las Vegas between April 12th and 14th, please join Joshua Blake, Neil Roodyn, Rick Barraza, Bart Roozendaal, Josh Santangelo, Nicolas Calvi and myself for some NUI fun! See you in Vegas! Tags van Technorati: mix11,las vegas,surface,nui,kinecct

    Read the article

  • SOA Community Newsletter September 2012

    - by JuergenKress
    Dear SOA partner community member Are you ready for Oracle Open World 2012? If you are planning to attend, make sure that you prepare your trip to San Francisco. If you could not make it, watch the keynotes live on-demand. You can also plan and decide to visit the SOA, Cloud and Service Technology Symposium 2012 and meet Tim Hall and Demed Lher from our product management team in London. As an Oracle partner you will get 50% discount on the conference pass, please use the code DJMXZ370 and avail your discount. The BPM Solution Catalogue is now live, make sure you use the process examples and contribute your processes. SOA Proactive support is the best resource to support your SOA implementations. To administrate your SOA systems Enterprise Manager Cloud Control 12c is the best tool, you can now attend thefree on-demand training. EM12c, Real User Experience Insight 12R1 gives you all the details, checkout our new demo. The BPM11g demo for Oracle E-Business Suite has become available. A wonderful SOA demo case is the Fusion Order Demo, Antony Reynolds posted an article how to update it on SOA Suite PS5. If you do use Coherence e.g. for SOA Suite, checkout the extension from our partner CloudTran. In this edition to this you will also find articles from: Automatically Disable Proxy Service to avoid overloading OSB By Jian Liang & Storing SCA Metadata in the Oracle Metadata Services Repository by Nicolás Fonnegra Martinez and Markus Lohn & Exploring MDS Explorer by Mark Nelson & Using Cloud OER to Find Fusion Applications On-Premise Service Concrete WSDL URL by Rajesh Raheja & Oracle Service Bus duplicate message check using Coherence by Jan van Zoggel & Installing Oracle SOA Suite10g on Oracle Enterprise Linux Lonneke Dikmans & Generating an EJB SDO Service Interface for Oracle SOA Suite by Edwin Biemond. Jürgen Kress Oracle SOA & BPM Partner Adoption EMEA To read the newsletter please visit http://tinyurl.com/soanewsSeptember2012 (OPN Account required) To become a member of the SOA Partner Community please register at http://www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center. Blog Twitter LinkedIn Mix Forum Technorati Tags: SOA Community newsletter,SOA Community,Oracle SOA,Oracle BPM,BPM Community,OPN,Jürgen Kress

    Read the article

  • Microsoft Ajax Control Toolkit vs. jQuery

    - by Juri
    Hi, we are currently developing a couple of custom asp.net server controls. Now we'd like to add some Ajax support to some of them. Now basically there would be two options Microsoft Ajax & Microsoft Ajax Control Toolkit jQuery I worked already with the Control Toolkit, writing a complete Extender and it was quite intuitive, once you understand the story behind. But I also like the simplicity of jQuery. So I'd like to hear some of you what you would like to go for (advantages/disadvantages of each of them), considering also that we're mainly dealing with Microsoft technologies. Would you go more for the toolkit or jQuery,...or both? //Edit: I just made some tests and I have to admit that at the moment I find the Toolkit better due to the integration. My purpose is mainly for using it on the server controls, so with the toolkit I have corresponding classes on the server-side where I can do something like CalendarExtender toolkitCalendarExtender = new CalendarExtender(); toolkitCalendarExtender.TargetControlID.... ... this.Controls.Add(toolkitCalendarExtender); This is really nice because in this way I don't have to deal with rendering predefined JavaScript which I construct somehow as string inside my custom server control. With jQuery I would have to do so (except for the toolkit Nicolas mentioned, but the support there is too weak for using it in a professional environment) Thanks a lot.

    Read the article

  • jeditable not working

    - by zurna
    I did not make any changes on the code. I dont receive any errors but its not working. I must be missing something very very simple here. Any suggestion appreciated... Test link. http://www.aslanyurek.com/inner.asp?Section=commentary&CommentaryID=1 $('.GameStory').editable('content/commentary/index.cs.asp?Process=EditLiveCommentary&CommentaryID=<%=Request.QueryString("CommentaryID")%>', { type : 'textarea', id : 'elementid', name : 'CommentaryDesc', cancel : 'Cancel', submit : 'OK', indicator : '<img src="img/indicator.gif">', tooltip : 'Click to edit...', cssclass : 'someclass' }); <div class="GameStory"> <p><span class="minute">36'</span>Here comes the pressure as Chelsea suddenly begin to up the tempo and Bolton can't keep the ball or clear it out of their own half.</p> <p><span class="minute">34'</span>Yuri Zhirkov, despite his head wound, is having a really good game and seems to be enjoying the freedom that he has been given to attack from his left back berth tonight.</p> <p><span class="minute">27'</span>Drogba whips in a free-kick that Jaaskelainen, for some reason, decides to punch straight into the face of Salomon Kalou who watches on as the ball rolls agonisingly of the post. Scare for Bolton.</p> <p><span class="minute">4'</span>Chelsea face Bolton at 8pm on Tuesday, April 13th.</p> <p><span class="minute">3'</span>Lively start at the Bridge with both sides looking to attack - it is by no means a defensive lineup from Owen Coyle so this could be an interesting game.</p> <p><span class="minute">0'</span>Nicolas Anelka gets the first shot of the match in on goal but its very tamely struck and Jaaskelainen gathers easily.</p> </div>

    Read the article

  • Silverlight Cream for January 11, 2011 -- #1024

    - by Dave Campbell
    1,000 blogposts is quite a few, but to die-hard geeks, 1000 isn't the number... 1K is the number, and today is my 1K blogpost! I've been working up to this for at least 11 months. Way back at MIX10, I approached some vendors about an idea I had. A month ago I contacted them and others, and everyone I contacted was very generous and supportive of my idea. My idea was not to run a contest, but blog as normal, and whoever ended up on my 1K post would get some swag... and I set a cut-off at 13 posts. So... blogging normally, I had some submittals, and then ran my normal process to pick up the next posts until I hit a total of 13. To provide a distribution channel for the swag, everyone on the list, please send me your snail mail (T-shirts) and email (licenses) addresses as soon as possible.   I'd like to thank the following generous sponsors for their contributions to my fun (in alphabetic order): and Rachel Hawley for contributing 4 Silverlight control sets First Floor Software and Koen Zwikstra for contributing 13 licenses for Silverlight Spy and Sara Faatz/Jason Beres for contributing 13 licenses for Silverlight Data Visualization controls and Svetla Stoycheva for contributing T-Shirts for everyone on the post and Ina Tontcheva for contributing 13 licenses for RadControls for Silverlight + RadControls for Windows Phone and Charlene Kozlan for contributing 1 combopack standard, 2 DataGrid for Silverlight, and 2 Listbox for Silverlight Standard And now finally...in this Issue: Nigel Sampson, Jeremy Likness, Dan Wahlin, Kunal Chowdhurry, Alex Knight, Wei-Meng Lee, Michael Crump, Jesse Liberty, Peter Kuhn, Michael Washington, Tau Sick, Max Paulousky, Damian Schenkelman Above the Fold: Silverlight: "Demystifying Silverlight Dependency Properties" Dan Wahlin WP7: "Using Windows Phone Gestures as Triggers" Nigel Sampson Expression Blend: "PathListBox: making data look cool" Alex Knight From SilverlightCream.com: Using Windows Phone Gestures as Triggers Nigel Sampson blogged about WP7 Gestures, the Toolkit, and using Gestures as Triggers, and actually makes it looks simple :) Jounce Part 9: Static and Dynamic Module Management Jeremy Likness has episode 9 of his explanation of his MVVM framework, Jounce, up... and a big discussion of Modules and Module Management from a Jounce perspective. Demystifying Silverlight Dependency Properties Dan Wahlin takes a page from one of his teaching opportunities, and shares his knowledge of Dependency Properties with us... beginning with what they are, defining them in code, and demonstrating their use. Customizing Silverlight ChildWindow Style using Blend Kunal Chowdhurry has a great post up about getting your Child Windows to match the look & feel of the rest of youra app... plus a bunch of Blend goodness thrown in. PathListBox: making data look cool File this post by Alex Knight in the 'holy crap' file along with the others in this series! ... just check out that cool Ticker Style Path ListBox at the top of the blog... too cool! Web Access in Windows Phone 7 Apps Wei-Meng Lee has the 3rd part of his series on WP7 development up and in this one is discussing Web Access... I mean *discussing* it... tons of detail, code, and explanation... great post. Prevent your Silverlight XAP file from caching in your browser. Michael Crump helps relieve stress on Silverlight developers everywhere by exploring how to avoid caching of your XAP in the browser... (WPFS) MVVM Light Toolkit: Soup To Nuts Part I Jesse Liberty continues his Windows Phone from Scratch series with a new segment exploring Laurent Bugnion's MVVMLight Toolkit beginning with acquiring and installing the toolkit, then proceeds to discuss linking the View and ViewModel, the ViewModel Locator, and page navigation. Silverlight: Making a DateTimePicker Peter Kuhn attacks a problem that crops up on the forums a lot -- a DateTimePicker control for Silverlight... following the "It's so simple to build one yourself" advice, he did so, and provides the code for all of us! Windows Phone 7 Animated Button Press Michael Washington took exception to button presses that gave no visual feedback and produced a behavior that does just that. Using TweetSharp in a Windows Phone 7 app Tau Sick demonstrates using TweetSharp to put a twitter feed into a WP7 app, as he did in "Hangover Helper"... all the instructions from getting Tweeetshaprt to the code necessary. Bindable Application Bar Extensions for Windows Phone 7 Max Paulousky has a post discussing some real extensions to the ApplicationBar for WP7.. he begins with a bindable application bar by Nicolas Humann that I've missed, probably because his blog is in French... and extends it to allow using DelegateCommand. How to: Load Prism modules packaged in a separate XAP file in an OOB application Damian Schenkelman posts about Prism, AppModules in separate XAPs and running OOB... if you've tried this, you know it's a hassle.. Damian has the solution. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • XStream parse attributes and values at the same time

    - by gurbieta
    Hi, I have the following XML <search ver="3.0"> <loc id="ARBA0009" type="1">Buenos Aires, Argentina</loc> <loc id="BRXX1283" type="1">Buenos Aires, Brazil</loc> <loc id="ARDF0127" type="1">Aeroparque Buenos Aires, Argentina</loc> <loc id="MXJO0669" type="1">Concepcion De Buenos Aires, Mexico</loc> <loc id="MXPA1785" type="1">San Nicolas De Buenos Aires, Mexico</loc> <loc id="ARBA0005" type="1">Balcarce, Argentina</loc> <loc id="ARBA0008" type="1">Bragado, Argentina</loc> <loc id="ARBA0010" type="1">Campana, Argentina</loc> <loc id="ARBA0016" type="1">Chascomus, Argentina</loc> <loc id="ARBA0019" type="1">Chivilcoy, Argentina</loc> </search> And a City class public class City { private String id; private Integer type; private String name; // getters & setters... } I tried the following aliases to parse the XML xStream.alias("search", List.class); xStream.alias("loc", City.class); xStream.useAttributeFor("id", String.class); xStream.useAttributeFor("type", Integer.class); But I can't figure out how to set the value of the "loc" tag, if I try to transform the City object in XML I get <search> <loc id="ARBA0001" type="1"> <name>Buenos Aires</name> </loc> </search> When I really need to get this <search> <loc id="ARBA0001" type="1">Buenos Aires</loc> </search> Then, if I try to parse the XML to a City object I get the field "name" with a null value. Anybody knows how to set te correct aliases to do this? Thanks in advance.

    Read the article

  • CSS Drop-Shadows Without Images

    - by Spencer B.
    I'm trying to use Nicolas Gallagher's brilliant CSS work on applying CSS drop-shadows to elements without images and without extra markup using the :before and :after pseudo-elements. His code is provided below... .drop-shadow { position:relative; width:90%; } .drop-shadow:before, .drop-shadow:after { content:""; position:absolute; z-index:-1; bottom:15px; left:10px; width:50%; height:20%; max-width:300px; -webkit-box-shadow:0 15px 10px rgba(0, 0, 0, 0.7); -moz-box-shadow:0 15px 10px rgba(0, 0, 0, 0.7); box-shadow:0 15px 10px rgba(0, 0, 0, 0.7); -webkit-transform:rotate(-3deg); -moz-transform:rotate(-3deg); -o-transform:rotate(-3deg); transform:rotate(-3deg); } .drop-shadow:after{ right:10px; left:auto; -webkit-transform:rotate(3deg); -moz-transform:rotate(3deg); -o-transform:rotate(3deg); transform:rotate(3deg); } I'm trying to target all images wrapped with an a tag, which in Wordpress are really full-size images that have been resized to a medium height and width in the backend. When the user clicks on the smaller image in the post, it opens up a new tab with the fullsize view of the image (I'm sure you're already familiar with this if you use Wordpress). For some reason, I can't get his code to work, and I'm wondering if I'm targeting this wrong within my CSS. Can you help? In place of the .drop-shadow class that he uses, I'm target all images wrapped with an a tag within the #main-i div. So, like this... #main-i a img Does anyone know how to target it better than I have so that I can get the drop shadows to be applied for all images within the specified div? Thanks for your help! P.S. An example of the image I am wanting to target with this CSS is the picture of the Haitian boy here: http://lifebridgecypress.org/our-heart/seventy-two/help-haiti

    Read the article

  • Attaching a Command to the WP7 Application Bar.

    - by mbcrump
    One of the biggest problems that I’ve seen with people creating WP7 applications is how do you bind the application bar to a Relay Command. If your using MVVM then this is particular important. Let’s examine the code that one might add to start with.  <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/icons/appbar.questionmark.rest.png" Text="About"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding DisplayAbout, Mode=OneWay}" /> </i:EventTrigger> </i:Interaction.Triggers> </shell:ApplicationBarIconButton> <shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"></shell:ApplicationBarMenuItem> <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"></shell:ApplicationBarMenuItem> </shell:ApplicationBar.MenuItems> </shell:ApplicationBar> </phone:PhoneApplicationPage.ApplicationBar> Everything looks right. But we quickly notice that we have a squiggly line under our Interaction.Triggers. The problem is that the object is not a FrameworkObject. This same code would have worked perfect if this were a normal button. OK. Point has been proved. Let’s make the ApplicationBar support Commands. So, go ahead and create a new project using MVVM Light. If you want to check out the source and work along side this tutorial then click here.  7 Easy Steps to have binding on the Application Bar using MVVM Light (I might add that you don’t have to use MVVM Light to get this functionality, I just prefer it.) 1) Download MVVM Light if you don’t already have it and install the project templates. It is available at http://mvvmlight.codeplex.com/. 2) Click File-New Project and navigate to Silverlight for Windows Phone. Make sure you use the MVVM Light (WP7) Template. 3) Now that we have our project setup and ready to go let’s download a wrapper created by Nicolas Humann here, it is called Phone7.Fx. After you download it then extract it somewhere that you can find it. This wrapper will make our application bar/menu item bindable. 4) Right click References inside your WP7 project and add the .dll file to your project. 5) In your MainPage.xaml you will need to add the proper namespace to it. Don’t forget to build your project afterwards. xmlns:Preview="clr-namespace:Phone7.Fx.Preview;assembly=Phone7.Fx.Preview" 6) Now you can add the BindableAppBar to your MainPage.xaml with a few lines of code.  <Preview:BindableApplicationBar x:Name="AppBar" BarOpacity="1.0" > <Preview:BindableApplicationBarIconButton Command="{Binding DisplayAbout}" IconUri="/icons/appbar.questionmark.rest.png" Text="About" /> <Preview:BindableApplicationBar.MenuItems> <Preview:BindableApplicationBarMenuItem Text="Settings" Command="{Binding InputBox}" /> </Preview:BindableApplicationBar.MenuItems> </Preview:BindableApplicationBar> So your final MainPage.xaml will look similar to this: NOTE: The AppBar will be located inside of the Grid using this wrapper.   <!--LayoutRoot contains the root grid where all other page content is placed--> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <!--TitlePanel contains the name of the application and page title--> <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12"> <TextBlock x:Name="ApplicationTitle" Text="{Binding ApplicationTitle}" Style="{StaticResource PhoneTextNormalStyle}" /> <TextBlock x:Name="PageTitle" Text="{Binding PageName}" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}" /> </StackPanel> <!--ContentPanel - place additional content here--> <Grid x:Name="ContentGrid" Grid.Row="1"> <TextBlock Text="{Binding Welcome}" Style="{StaticResource PhoneTextNormalStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" /> </Grid> <Preview:BindableApplicationBar x:Name="AppBar" BarOpacity="1.0" > <Preview:BindableApplicationBarIconButton Command="{Binding DisplayAbout}" IconUri="/icons/appbar.questionmark.rest.png" Text="About" /> <Preview:BindableApplicationBar.MenuItems> <Preview:BindableApplicationBarMenuItem Text="Settings" Command="{Binding InputBox}" /> </Preview:BindableApplicationBar.MenuItems> </Preview:BindableApplicationBar> </Grid> 7) Let’s go ahead and create the RelayCommands and write them up to a MessageBox by editing our MainViewModel.cs file. public class MainViewModel : ViewModelBase { public string ApplicationTitle { get { return "MVVM LIGHT"; } } public string PageName { get { return "My page:"; } } public string Welcome { get { return "Welcome to MVVM Light"; } } public RelayCommand DisplayAbout { get; private set; } public RelayCommand InputBox { get; private set; } /// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { if (IsInDesignMode) { // Code runs in Blend --> create design time data. } else { DisplayAbout = new RelayCommand(() => { MessageBox.Show("About box called!"); }); InputBox = new RelayCommand(() => { MessageBox.Show("settings button called"); }); } } If you run the project now you should get something similar to this (notice the AppBar at the bottom):  Now if you hit the question mark then you will get the following MessageBox: The MenuItem works as well so for Settings: As you can see, its pretty easy to add a Command to the ApplicationBar/MenuItem. If you want to look through the full source code then click here.   Subscribe to my feed

    Read the article

< Previous Page | 5 6 7 8 9