Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: ARE YOU MENTAL ???? Pin
Pete O'Hanlon15-Apr-07 23:57
mvePete O'Hanlon15-Apr-07 23:57 
Questionxpath Vs xml validation with xsd Pin
praveenkumar palla15-Apr-07 21:03
praveenkumar palla15-Apr-07 21:03 
AnswerRe: xpath Vs xml validation with xsd Pin
Pete O'Hanlon15-Apr-07 22:20
mvePete O'Hanlon15-Apr-07 22:20 
Questiontree view in asp.net Pin
ayyp15-Apr-07 20:57
ayyp15-Apr-07 20:57 
AnswerRe: tree view in asp.net Pin
Christian Graus15-Apr-07 20:58
protectorChristian Graus15-Apr-07 20:58 
Questionhow to create a crystal report using a dataset Pin
rkherath15-Apr-07 20:46
rkherath15-Apr-07 20:46 
AnswerRe: how to create a crystal report using a dataset Pin
Judah Gabriel Himango16-Apr-07 10:09
sponsorJudah Gabriel Himango16-Apr-07 10:09 
QuestionWPF: Custom panel, exception [modified] Pin
espeholt_jr15-Apr-07 20:45
espeholt_jr15-Apr-07 20:45 
Hi... I'm writing my own panel class which of cause inherited from Panel. And the code here works just fine Smile | :) BUT if I make a property where the return type to fx int, it fails. And the exception I get is useless. Is this something with TypeConverters?

public class TestCell
{
    public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
        "Width",
        typeof(double),
        typeof(TestCell),
        new FrameworkPropertyMetadata(
            0d,
            FrameworkPropertyMetadataOptions.None));

    public static void SetWidth(UIElement element, double value)
    {
        element.SetValue(WidthProperty, value);
    }

    public static double GetWidth(UIElement element)
    {
        return (double)element.GetValue(WidthProperty);
    }
}

public class TestPanel : Panel
{
    protected override Size MeasureOverride(Size availableSize)
    {
        Size childSize = availableSize;

        foreach (UIElement child in InternalChildren)
        {
            child.Measure(childSize);
        }

        return availableSize;
    }

    protected override Size ArrangeOverride(Size finalSize)
    {
        foreach (UIElement child in InternalChildren)
        {
            double x = TestCell.GetWidth(child);
            double y = 50;

            child.Arrange(new Rect(new Point(x, y), child.DesiredSize));
        }

        return finalSize; // Returns the final Arranged size
    }
}


<Window x:Class="WPFApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="clr-namespace:MyAssembly;assembly=MyAssembly"
    Title="Window1" Height="300" Width="300">
    <mc:TestPanel>
		<Button Width="100" Height="100"/>
    </mc:TestPanel>
</Window>



-- modified at 8:59 Monday 16th April, 2007

Best regards
Lasse Espeholt

QuestionHelp me uninstall in C# window form application Pin
phantanagu15-Apr-07 20:37
phantanagu15-Apr-07 20:37 
AnswerRe: Help me uninstall in C# window form application Pin
Christian Graus15-Apr-07 20:57
protectorChristian Graus15-Apr-07 20:57 
GeneralRe: Help me uninstall in C# window form application Pin
phantanagu15-Apr-07 21:55
phantanagu15-Apr-07 21:55 
AnswerRe: Help me uninstall in C# window form application Pin
sujithkumarsl15-Apr-07 21:20
sujithkumarsl15-Apr-07 21:20 
GeneralRe: Help me uninstall in C# window form application Pin
phantanagu15-Apr-07 22:05
phantanagu15-Apr-07 22:05 
GeneralRe: Help me uninstall in C# window form application Pin
sujithkumarsl15-Apr-07 22:14
sujithkumarsl15-Apr-07 22:14 
QuestionExecutable containing executable Pin
apostleofzion115-Apr-07 19:29
apostleofzion115-Apr-07 19:29 
AnswerRe: Executable containing executable Pin
Christian Graus15-Apr-07 19:48
protectorChristian Graus15-Apr-07 19:48 
GeneralRe: Executable containing executable Pin
apostleofzion115-Apr-07 20:01
apostleofzion115-Apr-07 20:01 
GeneralRe: Executable containing executable Pin
Christian Graus15-Apr-07 20:33
protectorChristian Graus15-Apr-07 20:33 
GeneralRe: Executable containing executable Pin
espeholt_jr15-Apr-07 21:04
espeholt_jr15-Apr-07 21:04 
GeneralRe: Executable containing executable Pin
apostleofzion116-Apr-07 17:45
apostleofzion116-Apr-07 17:45 
QuestionRichtext Box undo problem Pin
7115-Apr-07 18:59
7115-Apr-07 18:59 
AnswerRe: Richtext Box undo problem Pin
Stefan Troschuetz15-Apr-07 21:06
Stefan Troschuetz15-Apr-07 21:06 
Questionthreads and acknowledgment Pin
joshkim8115-Apr-07 18:33
joshkim8115-Apr-07 18:33 
AnswerRe: threads and acknowledgment Pin
Luc Pattyn15-Apr-07 22:10
sitebuilderLuc Pattyn15-Apr-07 22:10 
AnswerRe: threads and acknowledgment Pin
pbraun16-Apr-07 5:16
pbraun16-Apr-07 5:16 

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.