locked
App.xaml resource not found MVVM RRS feed

  • Question

  • Hello,

    I have a converter inside a folder like this.

    DataAccess ->

                           ConvertFromNull.cs

    I have all my xaml-code inside my app.xaml which contains all my contenttables.

    Now I want to add an converter on one of my binding inside my textbox but it comes back saying "The resource "ConvertFromNull" could not be resolved.

    How would I go about it?

     <TextBox Text="{Binding Path=CatWeight.Weight, Mode=TwoWay, Converter={StaticResource ResourceKey=ConverterFromNull}}" InputScope="Number" />

    Monday, July 7, 2014 7:39 PM

Answers

  • Fixed it. I defined my resource inside in my application and created my own resourcekey.
    • Marked as answer by coffeebakery Sunday, July 13, 2014 5:05 PM
    Sunday, July 13, 2014 5:05 PM

All replies

  • Post the app.xaml where you define the static resource 
    Monday, July 7, 2014 9:47 PM
  • Hi Ken,

    <Application x:Class="CatStats.App"      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:CatStats"
    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
    >

    Internactivity is because of my commands.

    Inside my app.caml.cs I have.

            private static AppViewModel _catVM { get; set; }
            public static AppViewModel CatVM
            {
                get
                {
                    if (_catVM == null)
                        _catVM = new AppViewModel();
                    return _catVM;
                }   
            }

    Tuesday, July 8, 2014 5:38 AM
  • ken did you find an answer to this? Or does anyone else have an idea?
    Wednesday, July 9, 2014 9:28 PM
  • I will try one more time.

    Does anyone have an idea about this?

    Friday, July 11, 2014 9:58 AM
  • Fixed it. I defined my resource inside in my application and created my own resourcekey.
    • Marked as answer by coffeebakery Sunday, July 13, 2014 5:05 PM
    Sunday, July 13, 2014 5:05 PM