Esempio n. 1
0
        /// <summary>
        /// Search by binding from DependencyObject collection.
        /// </summary>
        /// <typeparam name="T">Type of collection.</typeparam>
        /// <param name="collection">DependencyObject collection.</param>
        /// <param name="path">Binding path.</param>
        /// <param name="dataItem">DataItem.</param>
        /// <returns>Hit elements.</returns>
#else
        /// <summary>
        /// Binding情報から要素を検索。
        /// </summary>
        /// <typeparam name="T">コレクションのタイプ。</typeparam>
        /// <param name="collection">DependencyObjectのコレクション。</param>
        /// <param name="path">バインディングパス。</param>
        /// <param name="dataItem">DataItem。</param>
        /// <returns>ヒットした要素。</returns>
#endif
        public static IWPFDependencyObjectCollection <T> ByBinding <T>(IWPFDependencyObjectCollection <T> collection, string path, ExplicitAppVar dataItem = null) where T : DependencyObject
        {
            var app = (WindowsAppFriend)((IAppVarOwner)collection).AppVar.App;

            WPFStandardControls_3.Injection(app);
            return(new WPFDependencyObjectCollection <T>(app[typeof(SearcherInTarget), "ByBinding"](collection, path, dataItem)));
        }
Esempio n. 2
0
        /// <summary>
        /// Search by binding from DependencyObject collection.
        /// </summary>
        /// <param name="collection">DependencyObject collection.</param>
        /// <param name="path">Binding path.</param>
        /// <param name="dataItem">DataItem.</param>
        /// <returns>Hit elements.</returns>
        public static IDependencyObjectCollection ByBinding(this IDependencyObjectCollection collection, string path, ExplicitAppVar dataItem = null)
        {
            var app = ((IAppVarOwner)collection).AppVar.App;

            return(new DependencyObjectCollection(app.Type("Friendly.UWP.Core.UIElementSearcher").ByBinding(collection, path, dataItem)));
        }
Esempio n. 3
0
        /// <summary>
        /// Search by binding from DependencyObject collection.
        /// </summary>
        /// <typeparam name="T">Type of collection.</typeparam>
        /// <param name="collection">DependencyObject collection.</param>
        /// <param name="path">Binding path.</param>
        /// <param name="dataItem">DataItem.</param>
        /// <returns>Hit elements.</returns>
#else
        /// <summary>
        /// Binding情報から要素を検索。
        /// </summary>
        /// <typeparam name="T">コレクションのタイプ。</typeparam>
        /// <param name="collection">DependencyObjectのコレクション。</param>
        /// <param name="path">バインディングパス。</param>
        /// <param name="dataItem">DataItem。</param>
        /// <returns>ヒットした要素。</returns>
#endif
        public static IWPFDependencyObjectCollection <T> ByBinding <T>(this IWPFDependencyObjectCollection <T> collection, string path, ExplicitAppVar dataItem = null) where T : DependencyObject
        {
            return(Searcher.ByBinding <T>(collection, path, dataItem));
        }
        /// <summary>
        /// Search by CommandParameter from ButtonBase collection.
        /// </summary>
        /// <typeparam name="T">Type of collection.</typeparam>
        /// <param name="collection">ButtonBase collection.</param>
        /// <param name="commandParameter">Command parameter.</param>
        /// <returns>Hit elements.</returns>
#else
        /// <summary>
        /// コマンドパラメータから要素を検索。
        /// </summary>
        /// <typeparam name="T">コレクションのタイプ。</typeparam>
        /// <param name="collection">DependencyObjectのコレクション。</param>
        /// <param name="commandParameter">コマンドパラメータ。</param>
        /// <returns>ヒットした要素。</returns>
#endif
        public static IWPFDependencyObjectCollection <T> ByCommandParameter <T>(IWPFDependencyObjectCollection <T> collection, ExplicitAppVar commandParameter) where T : ButtonBase
        {
            return(ByCommandParameter(collection, (object)commandParameter));
        }
        /// <summary>
        /// Search by CommandParameter from ButtonBase collection.
        /// </summary>
        /// <typeparam name="T">Type of collection.</typeparam>
        /// <param name="collection">ButtonBase collection.</param>
        /// <param name="commandParameter">Command parameter.</param>
        /// <returns>Hit elements.</returns>
#else
        /// <summary>
        /// コマンドパラメータから要素を検索。
        /// </summary>
        /// <typeparam name="T">コレクションのタイプ。</typeparam>
        /// <param name="collection">DependencyObjectのコレクション。</param>
        /// <param name="commandParameter">コマンドパラメータ。</param>
        /// <returns>ヒットした要素。</returns>
#endif
        public static IWPFDependencyObjectCollection <T> ByCommandParameter <T>(this IWPFDependencyObjectCollection <T> collection, ExplicitAppVar commandParameter) where T : ButtonBase
        {
            return(ButtonSearcher.ByCommandParameter <T>(collection, commandParameter));
        }