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 9162471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:13:09+00:00 2026-06-17T14:13:09+00:00

This is my xaml: SelectedItem={Binding Source={StaticResource Settings}, Path=Default.Selected, Converter={StaticResource SelectedTabConverter}} I added Console.WriteLine() in

  • 0

This is my xaml:

SelectedItem="{Binding Source={StaticResource Settings}, Path=Default.Selected, Converter={StaticResource SelectedTabConverter}}"

I added Console.WriteLine() in Convert() and ConvertBack() so I could see that they were doing what they were supposed to do. However, when I checked my setting before saving it in my OnExit(), I saw that the setting was not changed. I thought this binding was two-way and I changed anything to the UI should change the setting at the same time. Any idea?

  • 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-17T14:13:10+00:00Added an answer on June 17, 2026 at 2:13 pm

    First, it’s hard to tell what your problem is without reading your previous question.

    You have created a Settings object as a resource in your App’s ResourceDictionary. There’s no need to do that. Just bind to the static Settings.Default object like shown below (and correctly shown in the answer to your other question).

    {Binding Path=Selected, Source={x:Static properties:Settings.Default}}
    

    where the XML namespace properties references the Properties namespace of your application.

    <Window ...
            xmlns:properties="clr-namespace:MyHomework__MVVM_.Properties"
            ... >
    

    Aside from that you should bind to the SelectedIndex property instead of SelectedItem. That way you would not need a converter at all.

    SelectedIndex="{Binding Path=Selected, Source={x:Static properties:Settings.Default}}"
    

    See also this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert this following XAML into code-behind: <ComboBox SelectedItem={Binding Level} ItemsSource={Binding Levels}
I have a control with this xaml: <Controls:TreeView x:Name=MachineGroupsTree Style={StaticResource MachineGroupStyle} > <i:Interaction.Triggers> <i:EventTrigger
In XAML I have a combobox defined as: <ComboBox x:Name=UsernameComboBox ItemsSource={Binding Users} DisplayMemberPath=Username SelectedItem={Binding
I'm fairly new to Data binding & XAML, so this probably is fairly simple
Consider the following XAML: <ComboBox Name=CompanyComboBox HorizontalAlignment=Stretch ItemsSource={Binding Path=GlobalData.Companies} SelectedValuePath=Id SelectedValue={Binding Customer.CompanyId, ValidatesOnDataErrors=True} DisplayMemberPath=Name
This XAML makes text fade in when it appears. I would like to put
Given this XAML: <StackPanel Orientation=Horizontal Grid.Row=1 Grid.Column=0 Margin=5> How can I assign the Grid.Row
I'm using this XAML: <Border x:Name=border1 Grid.Row=1> <toolkit:HeaderedContentControl Header=HeaderedContentControl HorizontalContentAlignment=Stretch VerticalContentAlignment=Stretch MaxWidth={Binding ActualWidth, ElementName=border1}
I have this XAML: <Window x:Class=WpfBindToCodeBehind.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Window1 Height=300 Width=300 Loaded=Window_Loaded> <StackPanel Orientation=Vertical>
So I have this Xaml inside a ListBox Item Template: <ListBox.ItemTemplate> <DataTemplate> <Grid Height=22

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.