Search Results

Search found 30874 results on 1235 pages for 'app xaml'.

Page 1/1235 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Getting Started Building Windows 8 Store Apps with XAML/C#

    - by dwahlin
    Technology is fun isn’t it? As soon as you think you’ve figured out where things are heading a new technology comes onto the scene, changes things up, and offers new opportunities. One of the new technologies I’ve been spending quite a bit of time with lately is Windows 8 store applications. I posted my thoughts about Windows 8 during the BUILD conference in 2011 and still feel excited about the opportunity there. Time will tell how well it ends up being accepted by consumers but I’m hopeful that it’ll take off. I currently have two Windows 8 store application concepts I’m working on with one being built in XAML/C# and another in HTML/JavaScript. I really like that Microsoft supports both options since it caters to a variety of developers and makes it easy to get started regardless if you’re a desktop developer or Web developer. Here’s a quick look at how the technologies are organized in Windows 8: In this post I’ll focus on the basics of Windows 8 store XAML/C# apps by looking at features, files, and code provided by Visual Studio projects. To get started building these types of apps you’ll definitely need to have some knowledge of XAML and C#. Let’s get started by looking at the Windows 8 store project types available in Visual Studio 2012.   Windows 8 Store XAML/C# Project Types When you open Visual Studio 2012 you’ll see a new entry under C# named Windows Store. It includes 6 different project types as shown next.   The Blank App project provides initial starter code and a single page whereas the Grid App and Split App templates provide quite a bit more code as well as multiple pages for your application. The other projects available can be be used to create a class library project that runs in Windows 8 store apps, a WinRT component such as a custom control, and a unit test library project respectively. If you’re building an application that displays data in groups using the “tile” concept then the Grid App or Split App project templates are a good place to start. An example of the initial screens generated by each project is shown next: Grid App Split View App   When a user clicks a tile in a Grid App they can view details about the tile data. With a Split View app groups/categories are shown and when the user clicks on a group they can see a list of all the different items and then drill-down into them:   For the remainder of this post I’ll focus on functionality provided by the Blank App project since it provides a simple way to get started learning the fundamentals of building Windows 8 store apps.   Blank App Project Walkthrough The Blank App project is a great place to start since it’s simple and lets you focus on the basics. In this post I’ll focus on what it provides you out of the box and cover additional details in future posts. Once you have the basics down you can move to the other project types if you need the functionality they provide. The Blank App project template does exactly what it says – you get an empty project with a few starter files added to help get you going. This is a good option if you’ll be building an app that doesn’t fit into the grid layout view that you see a lot of Windows 8 store apps following (such as on the Windows 8 start screen). I ended up starting with the Blank App project template for the app I’m currently working on since I’m not displaying data/image tiles (something the Grid App project does well) or drilling down into lists of data (functionality that the Split App project provides). The Blank App project provides images for the tiles and splash screen (you’ll definitely want to change these), a StandardStyles.xaml resource dictionary that includes a lot of helpful styles such as buttons for the AppBar (a special type of menu in Windows 8 store apps), an App.xaml file, and the app’s main page which is named MainPage.xaml. It also adds a Package.appxmanifest that is used to define functionality that your app requires, app information used in the store, plus more. The App.xaml, App.xaml.cs and StandardStyles.xaml Files The App.xaml file handles loading a resource dictionary named StandardStyles.xaml which has several key styles used throughout the application: <Application x:Class="BlankApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:BlankApp"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <!-- Styles that define common aspects of the platform look and feel Required by Visual Studio project and item templates --> <ResourceDictionary Source="Common/StandardStyles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>   StandardStyles.xaml has style definitions for different text styles and AppBar buttons. If you scroll down toward the middle of the file you’ll see that many AppBar button styles are included such as one for an edit icon. Button styles like this can be used to quickly and easily add icons/buttons into your application without having to be an expert in design. <Style x:Key="EditAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}"> <Setter Property="AutomationProperties.AutomationId" Value="EditAppBarButton"/> <Setter Property="AutomationProperties.Name" Value="Edit"/> <Setter Property="Content" Value="&#xE104;"/> </Style> Switching over to App.xaml.cs, it includes some code to help get you started. An OnLaunched() method is added to handle creating a Frame that child pages such as MainPage.xaml can be loaded into. The Frame has the same overall purpose as the one found in WPF and Silverlight applications - it’s used to navigate between pages in an application. /// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="args">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs args) { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) { throw new Exception("Failed to create initial page"); } } // Ensure the current window is active Window.Current.Activate(); }   Notice that in addition to creating a Frame the code also checks to see if the app was previously terminated so that you can load any state/data that the user may need when the app is launched again. If you’re new to the lifecycle of Windows 8 store apps the following image shows how an app can be running, suspended, and terminated.   If the user switches from an app they’re running the app will be suspended in memory. The app may stay suspended or may be terminated depending on how much memory the OS thinks it needs so it’s important to save state in case the application is ultimately terminated and has to be started fresh. Although I won’t cover saving application state here, additional information can be found at http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465099.aspx. Another method in App.xaml.cs named OnSuspending() is also included in App.xaml.cs that can be used to store state as the user switches to another application:   /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); } The MainPage.xaml and MainPage.xaml.cs Files The Blank App project adds a file named MainPage.xaml that acts as the initial screen for the application. It doesn’t include anything aside from an empty <Grid> XAML element in it. The code-behind class named MainPage.xaml.cs includes a constructor as well as a method named OnNavigatedTo() that is called once the page is displayed in the frame.   /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); } /// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { } }   If you’re experienced with XAML you can switch to Design mode and start dragging and dropping XAML controls from the ToolBox in Visual Studio. If you prefer to type XAML you can do that as well in the XAML editor or while in split mode. Many of the controls available in WPF and Silverlight are included such as Canvas, Grid, StackPanel, and Border for layout. Standard input controls are also included such as TextBox, CheckBox, PasswordBox, RadioButton, ComboBox, ListBox, and more. MediaElement is available for rendering video or playing audio files. Some of the “common” XAML controls included out of the box are shown next:   Although XAML/C# Windows 8 store apps don’t include all of the functionality available in Silverlight 5, the core functionality required to build store apps is there with additional functionality available in open source projects such as Callisto (started by Microsoft’s Tim Heuer), Q42.WinRT, and others. Standard XAML data binding can be used to bind C# objects to controls, converters can be used to manipulate data during the data binding process, and custom styles and templates can be applied to controls to modify them. Although Visual Studio 2012 doesn’t support visually creating styles or templates, Expression Blend 5 handles that very well. To get started building the initial screen of a Windows 8 app you can start adding controls as mentioned earlier. Simply place them inside of the <Grid> element that’s included. You can arrange controls in a stacked manner using the StackPanel control, add a border around controls using the Border control, arrange controls in columns and rows using the Grid control, or absolutely position controls using the Canvas control. One of the controls that may be new to you is the AppBar. It can be used to add menu/toolbar functionality into a store app and keep the app clean and focused. You can place an AppBar at the top or bottom of the screen. A user on a touch device can swipe up to display the bottom AppBar or right-click when using a mouse. An example of defining an AppBar that contains an Edit button is shown next. The EditAppBarButtonStyle is available in the StandardStyles.xaml file mentioned earlier. <Page.BottomAppBar> <AppBar x:Name="ApplicationAppBar" Padding="10,0,10,0" AutomationProperties.Name="Bottom App Bar"> <Grid> <StackPanel x:Name="RightPanel" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right"> <Button x:Name="Edit" Style="{StaticResource EditAppBarButtonStyle}" Tag="Edit" /> </StackPanel> </Grid> </AppBar> </Page.BottomAppBar> Like standard XAML controls, the <Button> control in the AppBar can be wired to an event handler method in the MainPage.Xaml.cs file or even bound to a ViewModel object using “commanding” if your app follows the Model-View-ViewModel (MVVM) pattern (check out the MVVM Light package available through NuGet if you’re using MVVM with Windows 8 store apps). The AppBar can be used to navigate to different screens, show and hide controls, display dialogs, show settings screens, and more.   The Package.appxmanifest File The Package.appxmanifest file contains configuration details about your Windows 8 store app. By double-clicking it in Visual Studio you can define the splash screen image, small and wide logo images used for tiles on the start screen, orientation information, and more. You can also define what capabilities the app has such as if it uses the Internet, supports geolocation functionality, requires a microphone or webcam, etc. App declarations such as background processes, file picker functionality, and sharing can also be defined Finally, information about how the app is packaged for deployment to the store can also be defined. Summary If you already have some experience working with XAML technologies you’ll find that getting started building Windows 8 applications is pretty straightforward. Many of the controls available in Silverlight and WPF are available making it easy to get started without having to relearn a lot of new technologies. In the next post in this series I’ll discuss additional features that can be used in your Windows 8 store apps.

    Read the article

  • Reusing elements in StandardStyles.xaml

    - by nmarun
    In one of my previous blogs (second point) , I mentioned not to modify the StandardStyles.xaml, but instead to create your own resource dictionary. I also mentioned how to declare your custom styles dictionary in the App.xaml file. If you want to reference or build upon from an existing style in the StandardStyles.xaml file, do the following: 1. Remove the entry for StandardStyles.xaml in the App.xaml file 2. Add your custom resource dictionary in the App.xaml file 1: <!-- App.xaml --> 2: <...(read more)

    Read the article

  • XAML Namespace http://schemas.microsoft.com/winfx/2006/xaml is not resolved

    - by Justin Poliey
    I'm using Visual Studio 2010 Express, working on a Silverlight 4 project in C#. This started happening all of a sudden in my project, I get the error that this XAML Namespace is not resolved: XAML Namespace http://schemas.microsoft.com/winfx/2006/xaml is not resolved If it helps, here is the section of the XAML file in which the error is being raised: <ResourceDictionary xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:GetGlue="clr-namespace:GetGluePlugin;assembly=GetGluePlugin" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:utils="clr-namespace:Seesmic.Sdp.Utils;assembly=Seesmic.Sdp.Utils"> What could the problem be?

    Read the article

  • My app 'Howzzat Book–Windows 8 Metro App is in the store now

    - by nmarun
    I’m just so excited that my application Howzzat Book passed all certifications and is now in the Windows Store. Here’s the email from MIcrosoft that I received: “Your app is in the Windows Store! Congratulations! Howzzat Book, release 1 is now in the Windows Store. Use this link to your app’s listing in the Windows Store to let others know about your app.” Link for Howzzat Book Now, since they’ve just added it to the store, it might take some time to be available for download. So if you don’t find...(read more)

    Read the article

  • XAML and WPF - Passing Variables to XAML Windows

    - by Erika
    Hi, I'm pretty new to WPF and i'm trying to load a XAML window and pass a variable to this XAML in its constructor or so, because i need it to load some items from this passed variable. Could anyone point me to the direction of how to go about this please? How does one start up a XAML window and give it a variable please? Thanks in advanced.. Erika

    Read the article

  • Mentioning a price for a service behind a free app in App Store

    - by David
    We are making a business service and have created an app to be used as a front-end. The app is free, but the service is not. Due to Apple taking 30% of in-app purchases, our service cannot be bought as an in-app purchase. My question is: Could Apple choose to throw out our app if we mention the price of the service in the description of our app in iTunes or in a help-text in the app? It seems unreasonable that this would cause problems, but the potential consequences to our business could be terrible so I want to make sure.

    Read the article

  • Is Windows 7 written in Xaml? [closed]

    - by Jordan
    Is Windows 7 written using Xaml? Edit Wow, so much hate for such a little question. I'm not an idiot. I know what XAML is. I use it every day. I was just curious whether some of the visual features were laid out with XAML, or if XAML was incorporated in some way to the product. I'm sorry if it is a programming sin not to know what Windows 7 was written in. I mean, I know Windows XP et al used C++/C, I've used Win32 quite a lot (and MFC and .NET).

    Read the article

  • How to center text around point using xaml

    - by Pete d'Oronzio
    I would like to be able to place the word "hello" centered on a specific point. I need to do this completely in XAML without extra code. Best I can tell, all the text alignment properties/styles in XAML act on text within some bouding canvas or other element. Since I don't know the length of the text I want to center, I can't center it using my own code. The reason I need to solve the problem entirely in XAML is that I'm not using WPF to create the XAML, I'm writing it directly to an XML DOM. It will then be loaded into a Silverlight or WPF control for display. In most graphic languages, including SVG, which is where my code originated, text can be aligned against a "stationary point" without a bounding box. Any suggestions appreciated

    Read the article

  • How to read Windows.UI.XAML.Style properties in C#

    - by Igor Kulman
    I am writing a class that will convert a HTML document to a list of Paragrpahs that can be used with RichTextBlock in Windows 8 apps. I want to be able to give the class a list of Styles defined in XAML and the class will read useful properties from the style and apply them. If I have a Windows.UI.XAML.Style style how do I read a property from it? I tried var fontWeight = style.GetValue(TextElement.FontWeightProperty) for a style defined in XAML with TargetProperty="TextBlock" but this fails with and exception

    Read the article

  • Silverlight insert XAML inside other XAML

    - by Code Burn
    I am using WPF and Silverlight BookControls by Mitsu http://www.codeplex.com/wpfbookcontrol The WPF example alows that every page in the book to be a XAML file, but the Silverlight example dont. Is there a way load a XAML in every book page in the Silverlight example ?

    Read the article

  • Proper XAML for Windows 8 Applications [closed]

    - by Jaapjan
    Traditionally, my programs do their work in the background and when I do have to make an interface for some reason, they often do not need to be complex which means I can use a simple Windows Forms or console application. But lets be honest-- Windows Forms? That is so ... ancient! Instead I have been looking at Windows 8. A new interface, different, maybe better-- but fun to give a try. Which means XAML. Now, XAML isn't all that hard in concept. Panel here, button there-- A smattering of XML. My question in short: Where can I find resources that teach me how to write good XAML code for Windows 8 applications? The long version: How do I combine XAML constructs to achieve effects? Horizontal panels with multiple sections you can scroll through with your finger, the proper way? How should you use default style resources Windows 8 might give you by default? How do I properly create a panel with user info on the right? Left aligned stackpanels with embedded dockpanels? Yes? No? Why?

    Read the article

  • Share an Interface between XAML and WinForms

    - by Nathan Friesen
    We're considering converting our WinForms application to a XAML application sometime in the future. Currently, our WinForms application uses lots of tabs, which we put use to display different User Control objects. All of these controls implement a specific Interface so we can make specific calls to them and not worry about what the actual control is (things like Save, Close, Clear, etc.) Would it be possible to create a WPF project that contains XAML User Controls that implement the same Interface and display those User Controls in the WinFroms project within a tab?

    Read the article

  • XAML Controls in WinForms

    - by Nathan Friesen
    We're considering converting our WinForms application to a WPF application. Part of the reason is that WPF/XAML seem to be the future. We are also using third party controls that we would like to be able to phase out. Making this conversion seems like a pretty big and time consuming undertaking, though. Would it make sense to develop XAML controls that could be used in our WinForms application as a first step in the process? My thinking is that the same controls would then be used in the WPF application and all of the look, feel, and functionality would be built into the controls in either environment.

    Read the article

  • what is the '<app-directory>' of remote_api in google-app-engine

    - by zjm1126
    http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html the api is : Downloading Data from App Engine To start a data download, run appcfg.py download_data with the appropriate arguments: appcfg.py download_data --config_file=album_loader.py --filename=album_data_archive.csv --kind=Album <app-directory> i want to download data from my gae app zjm1126.appspot.com so i write this in the commond: appcfg.py download_data --config_file=GreetingLoad.py --filename=GreetingLoad.csv but, i don't know how to write the 'app-directory' so , how to write the 'app-directory'.. thanks

    Read the article

  • More FlipBoard Magazines: Azure, XAML, ASP.NET MVC & Web API

    - by dwahlin
    In a previous post I introduced two new FlipBoard magazines that I put together including The AngularJS Magazine and The JavaScript & HTML5 Magazine. FlipBoard magazines provide a great way to keep content organized using a magazine-style format as opposed to trudging through multiple unorganized bookmarks or boring pages full of links. I think they’re really fun to read through as well. Based on feedback and the surprising popularity of the first two magazines I’ve decided to create some additional magazines on topics I like such as The Azure Magazine, The XAML Magazine and The ASP.NET MVC & Web API Magazine. Click on a cover below to get to the magazines using your browser. To subscribe to a given magazine you’ll need to create a FlipBoard account (not required to read the magazines though) which requires an iOS or Android device (the Windows Phone 8 app is coming soon they say). If you have a post or article that you think would be a good fit for any of the magazines please tweet the link to @DanWahlin and I’ll add it to my queue to review. I plan to be pretty strict about keeping articles “on topic” and focused.   The Azure Magazine   The XAML Magazine   The ASP.NET MVC & Web API Magazine   The AngularJS Magazine   The JavaScript & HTML5 Magazine

    Read the article

  • WPF: Xaml, create an observable collection<object> in xaml in Dot Net 4.0

    - by Aran Mulholland
    the web site says you can in dot net 4.0 I cant seem to do it though, what assesmbly references and xmlns' do i need the following does not work xmlns:coll="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib" <coll:ObservableCollection x:TypeArguments="x:Object"> <MenuItem Command="ApplicationCommands.Cut"/> <MenuItem Command="ApplicationCommands.Copy"/> <MenuItem Command="ApplicationCommands.Paste"/> </coll:ObservableCollection>

    Read the article

  • WPF: Xaml, create an observable collection<object> in xaml in .NET 4.0

    - by Aran Mulholland
    the web site says you can in .NET 4.0 I cant seem to do it though, what assesmbly references and xmlns' do i need the following does not work xmlns:coll="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib" <coll:ObservableCollection x:TypeArguments="x:Object"> <MenuItem Command="ApplicationCommands.Cut"/> <MenuItem Command="ApplicationCommands.Copy"/> <MenuItem Command="ApplicationCommands.Paste"/> </coll:ObservableCollection>

    Read the article

  • Accessing XAML Object Variables in XAML

    - by Asryael
    So, what I'm trying to do is access my Form's width and/or height to use in a storyboard. Essentially, I have a Translate Transform animation to slide what are essentially two pages. The animation works fine with hard coded From/To variables, however I need to use soft variables that enable the animation to start from the left/right of my form no matter what size it is. <Storyboard x:Key="SlideLeftToRight" TargetProperty="RenderTransform.(TranslateTransform.X)" AccelerationRatio=".4" DecelerationRatio=".4"> <DoubleAnimation Storyboard.TargetName="PageViewer" Duration="0:0:0.6" From="WindowWidth" To="0"/> <DoubleAnimation Storyboard.TargetName="BorderVisual" Duration="0:0:0.6" From="0" To="NegativeWindowWidth"/> </Storyboard> However, I have no idea how to do so. Any help is greatly appreciated. EDIT: I'm guessing it has something to do with: From="{Binding Width, Source=MainWindow}" However, when I attempt this, I don't know how to make it negative.

    Read the article

  • Implementing Ads on any page in your Windows 8 XAML app–part 2

    - by nmarun
    In my previous article , you saw how you can start implementing ads on some of the page templates. In this one, we’ll see how we can add something called ‘interstitial ads’ – ads that appear as part of the content in your app. I have added a Grouped Items page to my project. My data model is set to show a few appliances. I have a BaseModel class and the ApplianceModel that inherits the BaseModel class has two properties to represent an appliance. The ProductHolder acts as a container for a list of...(read more)

    Read the article

  • Implementing Ads on any page in your Windows 8 XAML app–part 1

    - by nmarun
    Let’s look at how you can implements ads on any page in your win 8 app. Before you get to your application, you need to create Ad Units in the MS Pubcenter site. Once you have set up your account with payout and tax details, go to the Setup tab and you’ll see something like below. There are a few options for the sizes of the ad units as shown on the Pubcenter site. Remember that these screenshots are just to give you some reference. The actual positioning of the ads in your apps is decided by you...(read more)

    Read the article

  • Introducing Visual WebGui's XAML programming model extension for web developers

    - by Visual WebGui
    While ASP.NET provides an event base approach it is completely dismissed when working with AJAX and the richness of the server is lost and replaced with JavaScript programming and couple with a very high security risk. Visual WebGui reinstates the power of the server to AJAX development and provides a statefull yet scalable, server centric architecture that provides the benefits and user productivity of AJAX with the security and developer productivity we had before AJAX stormed into our lives. When...(read more)

    Read the article

  • XAML | When used XamlReader.Parse, not able to refer the items using the LogicalTreeHelper/VisualTre

    - by Roopesh
    Hi, I am setting the dynamic xaml (I am reading the xaml from the DB) for the content of a tab using the below statement. Tab.Content = XamlReader.Parse(xaml, ctx) After setting the content, if I try getting the children using the VisualTreeHelper, but I am not able to get. How ever I dont have this issue when I construct the xaml statically. Here is the code to reading the xaml. Dim XmlDocument = New XmlDataDocument() Dim IID As String = Nothing Dim xaml As String = Nothing Dim Tab As New TabItem Dim TempPanel As XmlNode = Nothing 'Tab.Height = 0 Try XmlDocument.Load(Directory.GetCurrentDirectory & "\Xml\AppFile.xml") pXmlDoc = XmlDocument xaml = XmlDocument.SelectSingleNode("//Grid").OuterXml Dim AsmName As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name Dim ctx As ParserContext = New ParserContext() ' New ParserContext() ctx.XamlTypeMapper = New XamlTypeMapper(New String() {AsmName}) ctx.XamlTypeMapper.AddMappingProcessingInstruction("src", "WpfToolkitDataGridTester", AsmName) ctx.XmlnsDictionary.Add("", "http://schemas.microsoft.com/winfx/2006/xaml/presentation") ctx.XmlnsDictionary.Add("x", "http://schemas.microsoft.com/winfx/2006/xaml") ctx.XmlnsDictionary.Add("src", "clr-namespace:WpfToolkitDataGridTester;assembly=" + AsmName) Tab.Name = "Tab" & Grid1Tab.Items.Count + 1 Tab.Header = "AppFile-1" Tab.BorderThickness = New Thickness(0) Tab.IsSelected = True Tab.Content = XamlReader.Parse(xaml, ctx) Grid1Tab.Items.Add(Tab) Return True Catch ex As Exception Throw End Try Here is the code to access the item after constructing the XAML. For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(myVisual) - 1 Dim childVisual As Visual = CType(VisualTreeHelper.GetChild(myVisual, i), Visual) Select Case childVisual.DependencyObjectType.Name Case "ComboBox" AddHandler CType(childVisual, ComboBox).SelectionChanged, AddressOf ComboBox_SelectChanged Case "CheckBox" AddHandler CType(childVisual, CheckBox).Checked, AddressOf CheckBoxClicked AddHandler CType(childVisual, CheckBox).Unchecked, AddressOf CheckBoxClicked Case "RadioButton" AddHandler CType(childVisual, RadioButton).Checked, AddressOf CheckBoxClicked Case "TabControl" For Each item As System.Windows.Controls.TabItem In CType(childVisual, TabControl).Items EnumVisual(item.Content) Next End Select EnumVisual(childVisual) Next i any help is highly appreciated. Thanks,

    Read the article

  • WPF : Access Application Resources when not referencing Shell from App.xaml

    - by CF_Maintainer
    I am beginner in WPF. My App.xaml looks like below app.xaml <Application x:Class="ContactManager.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> <Color x:Key="lightBlueColor">#FF145E9D</Color> <SolidColorBrush x:Key="lightBlueBrush" Color="{StaticResource lightBlueColor}" /> </Application.Resources> I do not set the startupuri since I want to a presenter first approach. I do the following in app.xaml.cs protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var appPresenter = new ApplicationPresenter( new Shell(), new ContactRepository()); appPresenter.LaunchView(); } I have a usercontrol called "SearchBar.xaml" which references "lightBlueBrush" as a staticResource. When I try to open "Shell.xaml" in the designer it tells me : The "shell.xaml" cannot be loaded at design time because it says it could not create an instance of type "SearchBar.xaml". When I debugged the devenv.exe using another visual studio instance it tells me that it does not have access to the Brush I created in app.resources. If one is doing a Presenter first approach, how does one access resources? I had this working when the startupURI was "Shell.xaml" and the startup event was not present. Any clues/ideas/suggestions. I am just trying to understand. Everything works as expected when I run the application just not @ design time.

    Read the article

  • Silverlight DataGrid Refresh Between Xaml Files

    - by GB
    Hello, I have a Page.xaml file and a AddNewProject.xaml. In the Page.xaml file I have a ProjectDetailsDataGrid and a button to add a new Project. When I click on the Add New Project button the AddNewProject.xaml file becomes visible for the user to enter new project information. I am having a problem trying to refresh the ProjectDetailsDataGrid (on the Page.xaml page) to display the new info. entered from the AddNewProject.xaml page. Is there anyway to accomplish refreshing a datagrid between two seperate xaml files? Thank you for your help.

    Read the article

  • In hindsight, is basing XAML on XML a mistake or a good approach?

    - by romkyns
    XAML is essentially a subset of XML. One of the main benefits of basing XAML on XML is said to be that it can be parsed with existing tools. And it can, to a large degree, although the (syntactically non-trivial) attribute values will stay in text form and require further parsing. There are two major alternatives to describing a GUI in an XML-derived language. One is to do what WinForms did, and describe it in real code. There are numerous problems with this, though it’s not completely advantage-free (a question to compare XAML to this approach). The other major alternative is to design a completely new syntax specifically tailored for the task at hand. This is generally known as a domain-specific language. So, in hindsight, and as a lesson for the future generations, was it a good idea to base XAML on XML, or would it have been better as a custom-designed domain-specific language? If we were designing an even better UI framework, should we pick XML or a custom DSL? Since it’s much easier to think positively about the status quo, especially one that is quite liked by the community, I’ll give some example reasons for why building on top of XML might be considered a mistake. Basing a language off XML has one thing going for it: it’s much easier to parse (the core parser is already available), requires much, much less design work, and alternative parsers are also much easier to write for 3rd party developers. But the resulting language can be unsatisfying in various ways. It is rather verbose. If you change the type of something, you need to change it in the closing tag. It has very poor support for comments; it’s impossible to comment out an attribute. There are limitations placed on the content of attributes by XML. The markup extensions have to be built "on top" of the XML syntax, not integrated deeply and nicely into it. And, my personal favourite, if you set something via an attribute, you use completely different syntax than if you set the exact same thing as a content property. It’s also said that since everyone knows XML, XAML requires less learning. Strictly speaking this is true, but learning the syntax is a tiny fraction of the time spent learning a new UI framework; it’s the framework’s concepts that make the curve steep. Besides, the idiosyncracies of an XML-based language might actually add to the "needs learning" basket. Are these disadvantages outweighted by the ease of parsing? Should the next cool framework continue the tradition, or invest the time to design an awesome DSL that can’t be parsed by existing tools and whose syntax needs to be learned by everyone? P.S. Not everyone confuses XAML and WPF, but some do. XAML is the XML-like thing. WPF is the framework with support for bindings, theming, hardware acceleration and a whole lot of other cool stuff.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >