|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;
using Signum.Utilities;
using Signum.Utilities.ExpressionTrees;
using Signum.Utilities.Reflection;
using System.Reflection;
using System.ComponentModel;
using Signum.Entities;
using System.Collections;
using Signum.Entities.Reflection;
namespace Signum.Windows
{
public partial class EntityDetail : EntityBase
{
public static readonly DependencyProperty OrientationProperty =
DependencyProperty.Register("Orientation", typeof(Orientation), typeof(EntityDetail), new UIPropertyMetadata(Orientation.Vertical));
public Orientation Orientation
{
get { return (Orientation)GetValue(OrientationProperty); }
set { SetValue(OrientationProperty, value); }
}
public static readonly DependencyProperty EntityControlProperty =
DependencyProperty.Register("EntityControl", typeof(object), typeof(EntityDetail));
public object EntityControl
{
get { return (object)GetValue(EntityControlProperty); }
set { SetValue(EntityControlProperty, value); }
}
static EntityDetail()
{
ViewProperty.OverrideMetadata(typeof(EntityDetail), new FrameworkPropertyMetadata(false));
}
protected override void UpdateVisibility()
{
btCreate.Visibility = CanCreate() ? Visibility.Visible : Visibility.Collapsed;
btFind.Visibility = CanFind() ? Visibility.Visible : Visibility.Collapsed;
btView.Visibility = CanView() ? Visibility.Visible : Visibility.Collapsed;
btRemove.Visibility = CanRemove() ? Visibility.Visible : Visibility.Collapsed;
}
public EntityDetail()
{
InitializeComponent();
}
public override void OnLoad(object sender, RoutedEventArgs e)
{
base.OnLoad(sender, e);
contentPresenter.SetBinding(ContentControl.DataContextProperty, new Binding
{
Path = new PropertyPath(EntityProperty),
Source = this,
Converter = CleanLite ? Converters.Retrieve : null
});
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.
www.signumframework.com
I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...