Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8389445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:43:43+00:00 2026-06-09T18:43:43+00:00

I am trying to bind a XML page to same underlying code page. <toolkit:ToggleSwitch

  • 0

I am trying to bind a XML page to same underlying code page.

<toolkit:ToggleSwitch Foreground="Transparent" Checked="ToggleSwitch_Checked" IsChecked="{Binding Source={StaticResource appSettings}, Path=LockSetting, Mode=TwoWay}">
    <toolkit:ToggleSwitch.ContentTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical" DataContext="{Binding}">
                <TextBlock Text="locks or unlocks your calender" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock x:Name="statusBox" Text="{Binding stat1}" Style="{StaticResource PhoneTextTitle3Style}" />
            </StackPanel>
        </DataTemplate>
    </toolkit:ToggleSwitch.ContentTemplate>

I have set the data context as

stat1 = "abn";
InitializeComponent();

aps = this.Resources["appSettings"] as AppSettings;
this.colorpicker.Color = Color.FromArgb(aps.ASetting, aps.RSetting, aps.GSetting, aps.BSetting);
ContentPanel.DataContext = this;

But this is not working at all. Any help will be good.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:43:45+00:00Added an answer on June 9, 2026 at 6:43 pm

    When you write ContentPanel.DataContext = this it implies in this case that the Code-behind of the XAML would be providing context for the data binding. More specifically, when you write {Binding sta1} in the XAML, sta1 must be a property in the code behind. That is, sta1 should be something like that:

    public String sta1 { get; set; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add an attribute using javax.xml.bind.annotation to a simple type (String
I'm trying to bind to some XML data from my WPF application. I've set
I'm trying to bind a XML to POJOs using Simpleframework but it doesn't work
I am trying to bind the data from linq xml in isolated storage. The
I am trying to generate Java classes to bind xml to objects using castor.
I'm trying to bind datagrid to xml: <StackPanel.DataContext> <XmlDataProvider Source=bill.xml XPath=/Foods/Food/> </StackPanel.DataContext> <DataGrid Width=190
Hi I am trying to bind a SQL XML field to my gridview. The
I am trying to bind a CData element to a text box, in code.
I am trying to create objects using binding data from xml file to classes
Im trying to bind a list with datetime objects to my repeater. if (e.Item.ItemType

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.