Click here to Skip to main content
15,892,005 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Databinding CheckBox in a ListBox Pin
Ian Shlasko9-May-11 8:46
Ian Shlasko9-May-11 8:46 
GeneralRe: Databinding CheckBox in a ListBox Pin
kurmanc9-May-11 21:23
kurmanc9-May-11 21:23 
GeneralRe: Databinding CheckBox in a ListBox Pin
kurmanc11-May-11 6:11
kurmanc11-May-11 6:11 
GeneralRe: Databinding CheckBox in a ListBox Pin
Ian Shlasko11-May-11 11:47
Ian Shlasko11-May-11 11:47 
GeneralRe: Databinding CheckBox in a ListBox Pin
kurmanc11-May-11 21:17
kurmanc11-May-11 21:17 
QuestionCan you make a treeview behave like a tabcontrol? Pin
bfis1081379-May-11 6:16
bfis1081379-May-11 6:16 
AnswerRe: Can you make a treeview behave like a tabcontrol? Pin
Ian Shlasko9-May-11 6:31
Ian Shlasko9-May-11 6:31 
QuestionBool To Visibility Converter Problem Pin
Kevin Marois9-May-11 5:57
professionalKevin Marois9-May-11 5:57 
I'm trying to implement this BoolToVisibility converter (answer #4)
http://stackoverflow.com/questions/3128023/wpf-booleantovisibilityconverter-that-converts-to-hidden-instead-of-collapsed-whe[^]

So I added the class:

namespace Abtech.Spares.UI.Classes
{
    [ValueConversion(typeof(bool), typeof(Visibility))] 
    public sealed class BoolToVisibilityConverter : IValueConverter 
    {   
        public Visibility TrueValue { get; set; }   
        public Visibility FalseValue { get; set; }    

        public BoolToVisibilityConverter()   
        {     
            TrueValue = Visibility.Visible;     
            FalseValue = Visibility.Collapsed;   
        }    

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)   
        {     
            if (!(value is bool))       
                return null;     
        
            return (bool)value ? TrueValue : FalseValue;       
        }    

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)   
        {     
            if (Equals(value, TrueValue))       
                return true;     
            
            if (Equals(value, FalseValue))       
                return false;     
            
            return null;   
        } 
    } 
}


Then in the XAML I have

<UserControl x:Class="Abtech.Spares.UI.Views.ChildContentView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Abtech.Spares.UI.Classes;assembly=Abtech.Spares.UI"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d" 
             d:DesignHeight="300" 
             d:DesignWidth="300">

    <UserControl.Resources>
        <local:BoolToVisibilityConverter          
            x:Key="BoolToHiddenConverter"          
            TrueValue="Visible" 
            FalseValue="Hidden" />
    </UserControl.Resources>

    <Grid>

.
.
.
.


and I'm getting a compilation error
Abtech.Spares.UI	The tag 'BoolToVisibilityConverter' does not exist in XML namespace 'clr-namespace:Abtech.Spares.UI.Classes;assembly=Abtech.Spares.UI'. Line 13 Position 10.


You can see all the namespaces/references are correct. I don't see why this isn't working.

Anyone?
Everything makes sense in someone's mind

AnswerRe: Bool To Visibility Converter Problem Pin
Ian Shlasko9-May-11 6:09
Ian Shlasko9-May-11 6:09 
GeneralRe: Bool To Visibility Converter Problem Pin
Kevin Marois9-May-11 6:11
professionalKevin Marois9-May-11 6:11 
GeneralRe: Bool To Visibility Converter Problem Pin
Ian Shlasko9-May-11 6:19
Ian Shlasko9-May-11 6:19 
AnswerRe: Bool To Visibility Converter Problem Pin
SledgeHammer019-May-11 10:20
SledgeHammer019-May-11 10:20 
GeneralRe: Bool To Visibility Converter Problem Pin
AspDotNetDev9-May-11 11:09
protectorAspDotNetDev9-May-11 11:09 
Questionhow to get selected datagrid row items ? Pin
SRKSHOME8-May-11 21:28
SRKSHOME8-May-11 21:28 
AnswerRe: how to get selected datagrid row items ? Pin
Pete O'Hanlon8-May-11 21:44
mvePete O'Hanlon8-May-11 21:44 
GeneralRe: how to get selected datagrid row items ? Pin
SRKSHOME8-May-11 22:36
SRKSHOME8-May-11 22:36 
GeneralRe: how to get selected datagrid row items ? Pin
Pete O'Hanlon9-May-11 0:19
mvePete O'Hanlon9-May-11 0:19 
Questioncustom query Pin
picasso27-May-11 7:52
picasso27-May-11 7:52 
AnswerRe: custom query Pin
Pete O'Hanlon7-May-11 8:29
mvePete O'Hanlon7-May-11 8:29 
QuestionHow to set default location for google map on WP7 Pin
Nguyen Thanh Duc6-May-11 23:30
Nguyen Thanh Duc6-May-11 23:30 
AnswerRe: How to set default location for google map on WP7 Pin
Pete O'Hanlon6-May-11 23:34
mvePete O'Hanlon6-May-11 23:34 
QuestionExtended EDMX Pin
eddieangel6-May-11 7:21
eddieangel6-May-11 7:21 
AnswerRe: Extended EDMX Pin
Pete O'Hanlon6-May-11 7:35
mvePete O'Hanlon6-May-11 7:35 
GeneralRe: Extended EDMX Pin
eddieangel6-May-11 7:38
eddieangel6-May-11 7:38 
GeneralRe: Extended EDMX Pin
Pete O'Hanlon6-May-11 8:23
mvePete O'Hanlon6-May-11 8:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.