아래와 같이 바꾸기

:RadWindow 사용

 

App.xaml.cs

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WpfApp1
{
    /// <summary>
    /// App.xaml에 대한 상호 작용 논리
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            new MainWindow().Show();
            base.OnStartup(e);
        }
    }
}

App.xaml 

StartupUri="MainWindow.xaml" 항목제거

<Application x:Class="WpfApp1.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:WpfApp1"
             >
    <Application.Resources>
         
    </Application.Resources>
</Application>

MainWindow.xaml.cs

MainWindow : Window ->  MainWindow : RadWindow 로 변경

 

MainWindow.xaml

<Window Tag를  telerik:RadWindow 로 변경 하면 끝

<telerik:RadWindow
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        xmlns:navigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"
        navigation:RadWindowInteropHelper.ShowInTaskbar="True"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" x:Class="WpfApp1.MainWindow"
        mc:Ignorable="d"

         Height="450" Width="800">
    <Grid Margin="8,0,-8,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="154"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <telerik:RadRibbonView x:Name="radRibbonView" VerticalAlignment="Top" Height="151" Margin="-10,0,10,0">
            <telerik:RadRibbonTab Header="File">
                <telerik:RadRibbonGroup Header="Icon Test">
                    <telerik:RadRibbonButton Size="Large" LargeImage="pack://siteoforigin:,,,/Resources/open.png" Margin="0,0,0,-1" HorizontalAlignment="Stretch" MinHeight="2"/>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab/>
            <telerik:RadRibbonTab/>
        </telerik:RadRibbonView>
        <telerik:RadDocking HasDocumentHost="True" HorizontalAlignment="Stretch" Margin="-10,2,10,0" VerticalAlignment="Stretch" Grid.Row="1">
            <telerik:RadSplitContainer>
                <telerik:RadPaneGroup HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <telerik:RadPane Header="Pane 1"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>

    </Grid>
</telerik:RadWindow>

 

WebBrowser  Json 오류 , JQuery 오류 처리하기

 

기본 WebBrowser 대신에 ChromiumWebBrowser  사용해서 오류 없애기

 

CefSharp.Wpf 용 설치

설치하기 비주얼 스튜디오 닫기

프로젝트 구성관리자 지정하기 x86  또는 x64 하나만 지정해야됨

안하면 아래와 같이 뜸

아래와 같이 입력함

xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
   <cefSharp:ChromiumWebBrowser Grid.Row="0"
        Address="http://www.daum.net" />

전체소스

<Window x:Class="WpfApp1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        mc:Ignorable="d"
        xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"

        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <cefSharp:ChromiumWebBrowser Grid.Row="0"
        Address="http://www.daum.net" />
    </Grid>
</Window>

 

 

 

참고사이트

https://www.codeproject.com/Articles/881315/Display-HTML-in-WPF-and-CefSharp-Tutorial-Part

아래와 같이 컨트롤을 Grid에 넣으면 FindName으로 찾을수 엄따

http://msdn.microsoft.com/ko-kr/library/vstudio/system.windows.frameworkelement.registername(v=vs.100).aspx

실패

 
            DocumentViewer dv = new DocumentViewer();
            dv.Name = "documentViewer1";
            dv.Document = doucmentResult;
            this.printGrid.Children.Add(dv);

성공

            NameScope.SetNameScope(printGrid, new NameScope());

            this.printGrid.Children.Clear();
        
            DocumentViewer dv = new DocumentViewer();
            dv.Name = "documentViewer1";
            dv.Document = doucmentResult;
            this.printGrid.Children.Add(dv);
            printGrid.RegisterName(dv.Name, dv);

 

찾기

var documentViewer1 = (DocumentViewer)this.printGrid.FindName("documentViewer1");

배경을 Path 으로 넣었더니 너무 무거워서 이미지로 대체

반복적으로 이미지를 넣고 싶을때 ImageBrush를 사용하면된다.

http://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=KO-KR&k=k(System.Windows.Media.ImageBrush);k(VS.XamlEditor);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv3.5)&rd=true

image

 

 

 

        <StackPanel xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' Margin="0,0,0,127">
            <StackPanel.Background>
                <ImageBrush ImageSource="Rail.png" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,30,30" />
            </StackPanel.Background>
        </StackPanel>

 

ViewportUnits
가져오거나는 BrushMappingMode 를 지정 하는 열거형 여부 값을는 Viewport, 크기와 위치를 나타냅니다의 TileBrush 기준으로 타일, 출력 영역의 크기에 상대적입니다. (TileBrush에서 상속됨)

 

Viewport
위치와 크기에 대 한 기본 바둑판을 가져오거나는 TileBrush. (TileBrush에서 상속됨)

 

소켓통신으로 오브젝트를 넘기는데 이놈이 INotifyPropertyChanged 구현 되어져 있음 소켓으로 데이터를 넘기면 아래와같이 나옴

image

{"'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

어셈블리의 'System.ComponentModel.PropertyChangedEventManager' 형식이 serializable로 표시되어 있지 않습니다."}

 

해결방법

PropertyChangedEventHandler 이놈은 serializable 안함 ㅋ

 

        //public  event PropertyChangedEventHandler PropertyChanged;
        [field: NonSerialized]
        public event PropertyChangedEventHandler PropertyChanged;

        public void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

UIElement target

Point origin = new Point();

origin.X = target.RenderTransform.Value.OffsetX;

origin.Y = target.RenderTransform.Value.OffsetY;

아래의 메소드는 X 좌표를 움직이는데 자기 위치를 시작으로 특정 좌표까지 움직인다.

 

 

        public void CanvsXY(UIElement target, double newX)
        {
            Point origin = new Point();
            origin.X = target.RenderTransform.Value.OffsetX;
            origin.Y = target.RenderTransform.Value.OffsetY;
            var top = Canvas.GetTop(target);
            var left = Canvas.GetLeft(target);
            TranslateTransform trans = new TranslateTransform();
            target.RenderTransform = trans;
            DoubleAnimation anim2 = new DoubleAnimation(origin.X , newX - left, TimeSpan.FromSeconds(10));
            trans.BeginAnimation(TranslateTransform.XProperty, anim2);

        }

 

            this.label1.Background = (SolidColorBrush)new BrushConverter().ConvertFrom("#FFA36262");
            System.Windows.Media.Color col = (System.Windows.Media.Color)new ColorConverter().ConvertFrom("#FFA36262");

WPF 툴킷입니다.

다운로드 : http://wpftoolkit.codeplex.com/

사용환경

image

아래는 몇개의 DEMO 컨트롤

BusyIndicator

image

CalculatorUpDown

image

돋보기도 있네? ㅋ

image

The Extended WPF Toolkit is a collection of WPF controls, components and utilities made available outside the normal WPF Toolkit.

What's in the 1.5.0 Release?

사용방법

Instructions for using the Extended WPF Toolkit binaries:

  1. Install .NET Framework 4.0
  2. Download the ExtendedWPFToolkit_Binaries
  3. Unblock the ZIP file.
    1. Right-click ExtendedWPFToolkit_Binaries.zip -> Properties -> Unblock
  4. Unzip the ExtendedWPFToolkit_Binaries.zip
  5. Reference the binaries in your project:
    1. Reference WPFToolkit.Extended.dll in your project
    2. Add a using statement ("using Microsoft.Windows.Controls;") to the top of .cs files
    3. Add a new xmlns (for example, xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended") to the top of XAML files
    4. Remember to use the namespace prefix (in the above example, <extToolkit: ...>) in the body of your XAML

다운로드 경로

http://www.microsoft.com/download/en/details.aspx?id=27165#instructions

 

Overview

This software development kit (SDK) provides the binaries and programming reference for the Bing Maps WPF Control (Beta). You can use this control to build your own applications that use Bing Maps.

아래와 같이 네이트 알림창 처럼 프로그램 좌측하단 작업표시줄 위에 실행하기 위한 위치 값을 가지고 오는 부분입니다.

image

 

위치설청하기

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            SetMsgPopupArea();
            //this.Topmost = true;
            this.Focus();
        }

        
        private void SetMsgPopupArea()
        {
            this.Left = SystemParameters.WorkArea.Width - this.Width - 10;
            this.Top = SystemParameters.WorkArea.Height - this.Height;
        }
    }

 

창 설정을 통해 좀 더 이쁘게

image

 

 

image

 

완전히 테두리 없애기

AllowsTransparency="True"

image

 

image

+ Recent posts