Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
.NET Framework GroupsView
.NET Distributed_Apps
.NET
.NET ADO.NET
.NET ASP.NET
.NET ASP.NET Security
.NET ASP.NET Webcontrols
.NET ASP.NET Web Services
.NET Clr
.NET Compact Framework
.NET Drawing
.NET Interop
.NET Performance
.NET Web Services
.NET Windows Forms
.NET Windows Forms Controls
.NET General
.NET Csharp
.NET Visual Basic
.NET Vc
.NET Security
.NET Xml
Vsnet Debugging
Xml
Xsl
Scripting Jscript
Scripting Visual Basicscript
Scripting Wsh
Smartphone Developer
Visual Basic Com
Visual Basic Controls
Visual Basic Crystal
Visual Basic Database Ado
Visual Basic Syntax
Visual Basic Winapi
Vc Atl
Vc Debugger
Vc Language
Vc Mfc
Vc Stl
Visio Developer Visual Basica
Windowsce Embedded Vc
Windows Powershell
Visual Basic Vista Compatibility
Deployment Server
.NET Micro Porting

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft NET Csharp Posts  Ask A New Question 

Setting local namespace in xaml file

DeanB posted on Friday, June 20, 2008 3:52 AM

Please excuse my ignorance here as I have not used WPF for long, but
what is the statement that tells what the "local:" identifier is that
allows a window event to call a function in a .cs file?

Here is the top of a window definition in xaml: I've marked the area
in question with ?????. I have to call the TypeDirectoryValidationRule
function from within the xaml code. I'm also confused on what the

Thanks for any help!.


xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local=???????????????????????????????????????
Title="Type Directory Path" Height="164" Width="566" >
Value="0,3,5,5"></Setter>
Value="0,0,0,5"></Setter>
Value="5,5,5,5"></Setter>
your images:</Label>
local:TypeDirectoryValidationRule>


...

And here is the cs file

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.Shapes;
using System.Globalization;
using System.IO;
namespace SlideShowCS
{
/// <summary>
/// Interaction logic for fTypeDirectory.xaml
/// </summary>
public partial class fTypeDirectory : Window
{
public fTypeDirectory()
{
InitializeComponent();
}
}
public class TypeDirectoryValidationRule : ValidationRule
{
public override ValidationResult Validate(object value, CultureInfo
cultureInfo)
{
string sDirName = (string)value;
if (!Directory.Exists(sDirName))
{
string sMsg = string.Format("Directory does not exist: {1}",
sDirName);
return new ValidationResult(false, sMsg);
}
else
{
return new ValidationResult(true, null);
}
}
}
}
reply

 

Setting local namespace in xaml file

DeanB posted on Friday, June 20, 2008 3:53 AM

g
I found the answer. FWIW: It was:

xmlns:local=3D"clr-reference.SlideShowCS", where SlideShowCS is the
namespace for the app. I don't know why this is not explained in any
of the books. Anyone know what clr-reference actually is?
reply


Previous Microsoft NET Csharp conversation.